F
F
FashionHighStre2015-02-12 11:12:27
htaccess
FashionHighStre, 2015-02-12 11:12:27

Redirect eats direct label, how to fix?

The site has a redirect from pages with a slash to pages without a slash

Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ /$1 [R=301,L]

When a user comes from direct, the following happens: my-site.com/?yclid=234 changes to my-site.com?yclid=234 - that is, the slash disappears, what should I do in this situation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-02-18
@ShamblerR

the problem is that only RewriteCond can work with QUERY_STRING
RewriteRule itself cannot work with GET, but you can work on passing it through QSA
See how it works here:

RewriteCond %{REQUEST_FILENAME} !^favicon\.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,QSA]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question