Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- HTACCESS rewrite URL and remove Querystring


lostdreamer - 10:21 am on Jul 16, 2010 (gmt 0)


Hi all,

I'm sure this has been asked in other forms, but I can't for the likes of me get this thing working after googling/trying for hours.

I have a bunch of URLs like this:

example.com/scripts/gateway.php?action=SomeStaticAction&section=SomeDynamicSection


What I want is that all URLs will only be avaiable with clean URLs.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /scripts/gateway.php?action=SomeStaticAction&section=$1 [NC]


This works fine to create nice URLs like example.com/SomeStaticAction.html

Now I also want the URL
'/scripts/gateway.php?action=SomeStaticAction&section=SomeStaticAction' to 301 redirect to /SomeStaticAction.html

With everything I tried I either get no redirect or an infinite redirect because it will also redirect the querystring.

Can any Htaccess voodoo master help me with this?


Regards,
LostDreamer


Thread source:: http://www.webmasterworld.com/apache/4171357.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com