This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: 301 Redirect to SEO Url
Author
Message |
mpryan73
Newbie


Joined: 04 June 2011
Location: United States
Posts: 5
Posted: 27 February 2012 at 7:21am

 
I'm in the process of cleaning up some URL's  Old URL let say is

mainsite/catergory.cfm?catergoryID=18   and new one is

custom-railings-nh-ma-vt-me.html

When new one is called works great but when I call old one the redirect is not going to new url.

RewriteRule ^mainsite/catergory.cfm?catergoryID=18$ custom-railings-nh-ma-vt-me.html [R=301,L]

RewriteRule ^(custom-railings-nh-ma-vt-me.html)$ /mainsite/catergory.cfm?catergoryID=18 [NC,]


Thoughts?
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 28 February 2012 at 5:19am

Hello,

try using the following:
Code:
RewriteCond %{QUERY_STRING} ^catergoryID=18$ [NC]
RewriteRule ^mainsite/catergory\.cfm$ /custom-railings-nh-ma-vt-me.html [R=301,L]

instead of
Code:
RewriteRule ^mainsite/catergory.cfm?catergoryID=18$ custom-railings-nh-ma-vt-me.html [R=301,L]


Regards
Andrew
Back to Top
 
mpryan73
Newbie


Joined: 04 June 2011
Location: United States
Posts: 5
Posted: 28 February 2012 at 5:57am

Andrew one thing tough its passing  params 

custom-railings-nh-ma-vt-me.html?catergoryID=18

How do I prevent the appended ?catergoryID=18

Thank you for the help.
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 28 February 2012 at 7:11am

Try using it this way:

RewriteCond %{QUERY_STRING} ^catergoryID=18$ [NC]
RewriteRule ^mainsite/catergory\.cfm$ /custom-railings-nh-ma-vt-me.html? [R=301,L]

Regards
Andrew
Back to Top
 
mpryan73
Newbie


Joined: 04 June 2011
Location: United States
Posts: 5
Posted: 28 February 2012 at 7:22am

Andrew thanks for the help first off. I've been trying to learn/figure this stuff out for days. lol

Your second suggestion is the same as the first.  But I think I'm going to need something different.    Here are my needs.  

URL mainsite/catergory.cfm?PageNum_getpics=1&catergoryID=18

Needs to 301 to  custom-railings-nh-ma-vt-me.html/1/18/

The /1/18/  will need to be used.  This part of SEO URL I have working. I just need None SEO url's redirected.

RewriteRule ^custom-railings-nh-ma-vt-me.html/([0-9]+)/([0-9]+)/$ /mainsite/catergory.cfm?PageNum_getpics=$1&catergoryID=$2 [NC, L]
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 29 February 2012 at 4:28am

Take a second look. it's different.
For you other issue you'll need:

RewriteCond %{QUERY_STRING} ^PageNum_getpics=([^&]+)&catergoryID=([^&]+)$ [NC]
RewriteRule ^mainsite/catergory\.cfm$ /custom-railings-nh-ma-vt-me.html/%1/%2? [NC,R=301,L]

Regards
Andrew
Back to Top
 
mpryan73
Newbie


Joined: 04 June 2011
Location: United States
Posts: 5
Posted: 29 February 2012 at 7:44am

Andrew the suggestion is giving me

custom-railings-nh-ma-vt-me.html/1/%24n/?PageNum_getpics=1&catergoryID=18/

Not sure why the %24n   and can we drop the ?PageNum.... Param some how?

Thank you.
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 29 February 2012 at 8:00am

Please, provide the rewrite.log for the testing request.
Logging issues described in FAQ

Regards
Andrew
Back to Top
 
mpryan73
Newbie


Joined: 04 June 2011
Location: United States
Posts: 5
Posted: 29 February 2012 at 11:52am

Got it working.  Thanks for all your help.  It was operator error on my part. I'm dynamically generating .htaccess.
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version