Quote:
Originally Posted by wige
Ok, I have come to realize that the code I gave won't work for the root page of a folder (ie domain.tld/). The following code should work in all cases:
Code:
RewriteCond %{query_string} ref=pislikcs.com
RewriteRule (.*) http://www.example.com/$1? [R=301,L]
|
Thanks for trying, but that doesn't work. I had a few minutes spare so I tried it. This is what the resulting page is:
http://www.domain.com/page_name.html/page_name.html
As you can see, the page name is duplicated! It puts a slash on the end, the duplicates the page name. I tried both of these:
RewriteCond %{query_string} ref=pislikcs.com
RewriteRule (.*) http://www.domain.com/page_name.html/$1? [R=301,L]
AND:
RewriteCond %{query_string} ref=pislikcs.com
RewriteRule (.*) /page_name.html/$1? [R=301,L]
And I also tried removing the / after "html".
BTW, there's a question mark you left out, I don't know if that matters. The invalid bad appending data is
?ref=pislikcs.com