dimanche 27 septembre 2015

Laravel 5 : URL with trailing slashes gets redirected to localhost

I can access my url with http://localhost/rnd/public/coeg-admin but if I visit http://localhost/rnd/public/coeg-admin/ it gets redirected to http://localhost/coeg-admin.

I just follow laravel trailing Slashes redirect to localhost and URL with trailing slashes gets redirected to localhost in laravel 5

But it's doesn't work as expected, Here is my .htaccess

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

    RewriteEngine On

    # Set base URL
    # RewriteBase /rnd/public/
    # RewriteRule ^(.*)/$ /$1 [L,R=301]
    # RewriteCond %{REQUEST_URI} !^

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

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

Here is my apache2.conf

<Directory "/var/www/html/rnd/public">
        Options Indexes FollowSymLinks
        #AllowOverride None
        AllowOverride All
        Require all granted
</Directory>

<Directory "/var/www/html">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

How, I can redirect url with slashes at the end to url without slashes at the end ?

Thanks, any help appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire