Jump to content

301 Redirect Url With A "?" In It To A New Domain?


Recommended Posts



I have a 301 redirect setup in an old domain's htaccess file, but my URLs with "?" "&" and "%20" don't seem to be redirecting. So I thought I would ask the experts and see if anyone knows how to redirect a dynamic URL with special characters on an old domain to a static URL on new domain.


(*** added so no URLs are in post)


So I would like this URL:


To go to this URL:





Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]

redirect 301 /olddir/directory.php?CAT=100&catName=Widgets http://***.newdomain.***/widgets.php


Thanks for any advice!

Link to comment
Share on other sites

Hi Andy,


Thanks for taking a crack at it. I tried the code, but still can't get it to work. The pages show up as normal.


If this is going to be too complicated or time consuming to troubleshoot, is there an alternate method that could be used to redirect any URLs using that directory.php file.


So any page that calls "directory.php" and no matter what comes after it, would redirect to one page on a new domain?


like this URL:


would go to this URL:



this URL:


would go to this URL:




Thanks again for your help!

Link to comment
Share on other sites

Finally found what I needed... thanks again for all your help. It pointed me in the right direction


>Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/olddir/
RewriteCond %{QUERY_STRING} CAT=100&catName=Widgets
RewriteRule ^(.*)$ http://***.newdomain.***/widgets.php? [R=301,L]

Link to comment
Share on other sites

Join the conversation

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

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