Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Rewrite: query_string -> page


Kurieuo - 5:02 pm on Mar 16, 2003 (gmt 0)


I've been attempting to use rewrite in a htaccess file to redirect a page like:

/page.html?p=end
to
/index.html

After spending a few hours browsing the messages here, reading up on regular expressions and so on, I was finally able to come up with what I required:
rewriteCond %{query_string} p=end
rewriteRule ^page.html$ /index.html? [R,L]

It works, but I'm still thinking what I did may be dodgy - that is, there might be a better way? Something I did have trouble with was it would attach the query string (?p=end) to index.html - however I placed a '?' at the end and that got rid of it. :)

Are there any better ways of doing the redirect from a query string to another page without the query string being attached?

Thanks,
Kurieuo.


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