Help for simple rewriting
4 posts
• Page 1 of 1
Help for simple rewriting
Hi,
I would like to rewrite these URLs please:
FROM http://www.example.com/Details.cfm?ProdID=xxx
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x
TO http://www.example.com/Details.cfm?product=xxx&category=x
FROM http://www.example.com/Details.cfm?ProdID=xxx&secondary=x
TO http://www.example.com/Details.cfm?product=xxx&secondary=x
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x&secondary=x
TO http://www.example.com/Details.cfm?product=xxx&category=x&secondary=x
Basically all the "ProdID"s need to be changed to "product"
x=variable numbers
Thanks
David
I would like to rewrite these URLs please:
FROM http://www.example.com/Details.cfm?ProdID=xxx
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x
TO http://www.example.com/Details.cfm?product=xxx&category=x
FROM http://www.example.com/Details.cfm?ProdID=xxx&secondary=x
TO http://www.example.com/Details.cfm?product=xxx&secondary=x
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x&secondary=x
TO http://www.example.com/Details.cfm?product=xxx&category=x&secondary=x
Basically all the "ProdID"s need to be changed to "product"
x=variable numbers
Thanks
David
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help for simple rewriting
Hello,
Try using the following:
Regards
Andrew
Try using the following:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^ProdID=(.*)$ [NC]
RewriteRule ^details\.cfm$ /Details.cfm?product=%1 [NC,R=301,L]
Regards
Andrew
Re: Help for simple rewriting
Hi Andrew
Thanks you very much for a quick reply. Is it also possible to do:
FROM http://www.example.com/Details.cfm?ProdID=xxx
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&secondary=x
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x&secondary=x
TO http://www.example.com/Details.cfm?product=xxx
Basically renaming ProdID to product and get rid of category and secondary variables attached to the URLs and make a 301?
Kind regards
David
Thanks you very much for a quick reply. Is it also possible to do:
FROM http://www.example.com/Details.cfm?ProdID=xxx
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&secondary=x
TO http://www.example.com/Details.cfm?product=xxx
FROM http://www.example.com/Details.cfm?ProdID=xxx&category=x&secondary=x
TO http://www.example.com/Details.cfm?product=xxx
Basically renaming ProdID to product and get rid of category and secondary variables attached to the URLs and make a 301?
Kind regards
David
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help for simple rewriting
It's possible:
Regards
Andrew
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^ProdID=([^&]+)&.*$ [NC]
RewriteRule ^details\.cfm$ /Details.cfm?product=%1? [NC,R=301,L]
Regards
Andrew
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 18 guests