PDA

View Full Version : .htaccess Redirection Help


CSS
09-24-2009, 10:02 AM
I really have no knowledge as far as Apache/.htaccess/rewrites go... what I want to do is:

http://page.com/?redir=x - Replacing x with any URL, automatically redirects the page to that URL... for example: http://page.com/?redir=http://website.com/ will take you to website.com.

Doing this will set the referer from all redirects to http://page.com/?redir=x, correct?

charlesandrews
09-30-2009, 03:03 PM
I haven't actually tested this, but from this mod_rewrite guide (http://www.openzu.com/Tips-&-Tricks/Apache-Mod-Rewrite/p-44/) I think you would want to use:

RewriteRule http://www.yourdomain.com/?redir=(.*) $1 [R=301,L]

Let me know if this works for you, if not we can try something different.