0

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.

Community
  • 1
  • 1
Dark Cyber
  • 2,181
  • 7
  • 44
  • 68

1 Answers1

1

The simplest way I do was remove RewriteRule ^(.*)/$ /$1 [L,R=301] from the public/.htaccess

don't forget to clear cache too, because chrome redirecting-cache saved in browser too

Richard Octovianus
  • 190
  • 1
  • 2
  • 13