Jump to content

Recommended Posts

Posted

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.

Posted

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">

Posted
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!

Posted
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) :naughty: .

 

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 :D .

 

Rowan P.

Posted

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;
?>

Posted

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.

Posted (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! :naughty:

 

Thanks a lot Mike.

 

Rowan P.

Edited by rowanp

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...