Forum Moderators: phranque

Message Too Old, No Replies

Redirecting Dynamic Pages

Moving from one site to another

         

imnotinsane

12:12 am on Jun 2, 2008 (gmt 0)

10+ Year Member



I am moving from one domain to another domain and i am trying to setup redirects so i don't lose google rankings from the old site with 301, but everything on my site is generated dynamically so i am having trouble making this work.

I have the url:

www.example.com/oscom/index.php?cPath=21

here is what i have so far that doesn't seem to be working

RewriteCond %{query_string} ^cPath=21$
RewriteRule ^index\.php$ http://www.example.com/c/CategoryName/code [R=301,L]

Not exactly sure what i am doing wrong, would appreciate any help.

[edited by: jdMorgan at 1:19 am (utc) on June 2, 2008]
[edit reason] example.com [/edit]

jdMorgan

1:18 am on Jun 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't feel free to change case on anything from that shown in the documentation, and unless this code is located in /oscom/.htaccess, you will need to include "oscom/" in the RewriteRule pattern:

RewriteCond %{QUERY_STRING} ^cPath=21$
RewriteRule ^oscom/index\.php$ http://www.example.com/c/CategoryName/code [R=301,L]

If those points don't help, please post back and tell us how (specifically) "it doesn't work," the location of your .htaccess file (if you're using an .htaccess file), and whether you have any other working rewriterules in this file.

Jim

[edited by: jdMorgan at 1:18 am (utc) on June 2, 2008]

imnotinsane

1:34 am on Jun 2, 2008 (gmt 0)

10+ Year Member



Ahh, i didn't even notice i had changed the QUERY_STRING

I had been putting the .htaccess file directly into the oscom folder since i wasn't sure if maybe that was my problem.

Well, your prompt asking for the entire .htaccess file made me realise my mistake, i had left out an important line, RewriteEngine On

Thanks for that! :)

bilalseo

6:28 pm on Jun 3, 2008 (gmt 0)

10+ Year Member



Hehehehe:)