0

Sorry for the 1000000 topic on this, but I've been trying and searching for hours and couldn't find anything.

Basically, I have already used mod_rewrite to allow someone to type in www.example.com/web/chat/tf/

and that would go to www.example.com/web/index.php?mode=chat&game=tf

But now I need to block people from actually typing in the GET request URL (the second one), and make it the friendly one to prevent duplicate pointers. So really, if anyone types in index.php?mode=

I want it to reroute to simply index.php

Here's what I've tried (none of it has worked)

RewriteCond %{QUERY_STRING} mode.*
RewriteRule .* index.php

RewriteRule ^index.php\?.*$ index.php

RewriteCond %{REQUEST_URI} mode.*
RewriteRule .* index.php

Help?

1 Answer 1

0

I would use something like this :

RewriteCond %{QUERY_STRING} ^mode=
RewriteRule (.*) $1? [R=301,L]

So that for the given URL :

http://www.example.com/web/index.php?mode=chat&game=tf

It will return :

http://www.example.com/web/index.php

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .