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


lostdreamer - 1:58 pm on Jul 16, 2010 (gmt 0)


Thanks again g1smd for your help.
What I now have is the following (which is now working very nice):


# external 301 redirect old URLs to the clean ones
RewriteCond %{THE_REQUEST} ^.*scripts/(.*)section=([a-zA-Z]+).*
RewriteRule ^scripts/Gateway.php$ /%2.html? [R=301,L]

# www canonicalization
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

# All .html URLs should internally rewrite to the scripts/gateway.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z]+)\.html$ /scripts/Gateway.php?action=TextAction&section=$1 [NC,L]

[edited by: engine at 7:47 am (utc) on Jul 22, 2010]
[edit reason] member requested domain obfuscation [/edit]


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