0

I have Laravel installed in /var/www/html

I have a PHP script installed in /var/www/html/i/

The htaccess of /var/www/html/ is

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

The htaccess of /var/www/html/i/ is

<IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteRule ^(.+)$ /?variable=$1

</IfModule>

Trouble is whenever I go to

/i/somevariable

I get a 404 error from my laravel app.

lowerends
  • 5,469
  • 2
  • 24
  • 36
Onetest
  • 35
  • 1
  • 1
  • 8

2 Answers2

1

if you are using apache read mod_rewrite http://httpd.apache.org/docs/current/mod/mod_rewrite.html

dont just turn on, use rewrite rule

mandar
  • 98
  • 6
1

Make a .htaccess file in your root folder with this content:

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^([A-Za-z0-9-]+)/i/?$    index.php/i/?s=$1    [NC,L] 

This should work fine.

  • RewriteEngine On RewriteRule ^([A-Za-z0-9-]+)/i/?$ index.php/i/?s=$1 [NC,L] # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] – Onetest Jul 24 '14 at 09:24