rowanp Posted January 17, 2006 Posted January 17, 2006 Hi All I am having a bit of an issue with one particular cPanel Redirect. I want to redirect http://www.mysite.com/t1 to http://www.mysite.com/?a_aid=100. When I run the redirect by going to http://www.mysite.com/t1, it directs me to http://www.mysite.com/%3fa_aid=100. I understand the reasoning behind this, but my site responds with a "Page Not Found" error. It obviously makes the distinction between "?" and "%3f". Is there any way to force the redirect to use "?" instead of "%3f"? Regards Rowan P. Quote
TCH-Bruce Posted January 17, 2006 Posted January 17, 2006 Have you tried editing the .htaccess file manually? Quote
TCH-Mark Posted January 17, 2006 Posted January 17, 2006 Hello, Another option may be to place and index.htm or index.php file in the t1 folder and have that redirect the user with either a http refresh or a php redirect. PHP WAY: ><?php $to = 'http://www.example.com'; header('Location: '. $to); exit; ?> HTTP WAY: ><META HTTP-EQUIV="Refresh" Content= "0; URL=url here"> Quote
rowanp Posted January 17, 2006 Author Posted January 17, 2006 Have you tried editing the .htaccess file manually? Unfortunately, this won't work because this is written in the .htaccess file: "RedirectMatch permanent ^/t1$ http://www.mysite.com/?a_aid=100". If there was a special command that could be used to force this it would be great. Thanks for the suggestion! Quote
rowanp Posted January 17, 2006 Author Posted January 17, 2006 Another option may be to place and index.htm or index.php file in the t1 folder and have that redirect the user with either a http refresh or a php redirect. Thanks for the suggestion, I am actually doing this already (the html way). The problem is that you can see the .html file for a split second before it redirects (which lacks the eloquence I was hoping for) . Great idea though, a lot of affiliates (even one very prominent one I know) use this technique to "hide" the fact that they are affiliates. I love hitting the stop button just before it redirects to uncover the truth . Rowan P. Quote
TCH-Don Posted January 17, 2006 Posted January 17, 2006 Have you tried the php way use index.php It will redirect very fast just be sure there are no spaces before or after the lines before the header command. ><?php $to = 'http://www.example.com'; header('Location: '. $to); exit; ?> Quote
MikeJ Posted January 17, 2006 Posted January 17, 2006 RedirectMatch doesn't like special characters like the ?. What you can do since it appears you just want to redirect /t1 to another URL, the following should work beautifully for you: >Redirect permanent /t1 http://www.mysite.com/?a_aid=100 Just remove your RedirectMatch line in your .htaccess file and replace it with the above. Quote
rowanp Posted January 17, 2006 Author Posted January 17, 2006 (edited) RedirectMatch doesn't like special characters like the ?. What you can do since it appears you just want to redirect /t1 to another URL, the following should work beautifully for you: >Redirect permanent /t1 http://www.mysite.com/?a_aid=100 Just remove your RedirectMatch line in your .htaccess file and replace it with the above. Brilliant, it worked perfectly! Thanks a lot Mike. Rowan P. Edited January 17, 2006 by rowanp Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.