1

In my laravel app, I have the following https url:

https://example.com/segment1/segment2/?query=query&location=California.

Whenever it has question mark ? after forward slash /, the URL will removes the / and becomes to

https://example.com/segment1/segment2?query=query&location=California

I found similar issue here: Missing forward slash after fqdn, but my issue is with the last slash and I own the VPS server with .htaccess configuration:

htaccess:

<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]
</IfModule>

Tested in my localhost, the slash works fine no problem. Only happens on my production VPS server.

Have tried research for few hours but no ideas what might cause an issue. Any advises would be very appreciated.

Thank you in advanced.

Community
  • 1
  • 1
SonDang
  • 1,468
  • 1
  • 15
  • 21
  • what is the problem? your both urls should direct to the same page. Check this [answer](http://stackoverflow.com/questions/29855027/trailing-slash-before-a-query-string-bad-practice#answer-29865234) – Raghavendra N Sep 27 '16 at 17:44
  • Yes, the problem is If I add another segment3/ in url, it will become segment3?query=query&location=California, it removes the forward slash so in my app could not recognize the segment3 properly – SonDang Sep 28 '16 at 04:46

0 Answers0