| Author |
|
lightguy1 Groupie

Joined: 08 July 2008
Online Status: Offline Posts: 44
|
| Posted: 08 July 2008 at 10:10am | IP Logged
|
|
|
Ok, here is what my urls look like before a rewrite:
http://www.mysite.biz/moreinfo.int?itemno=item1
Here is what my URLs look like with the current rewrite configuration by my programmer:
http://www.mysite.biz/moreinfo.int/itemno/item1
I WOULD LIKE TO REWRITE THE MOREINFO.INT?ITEMNO TO SIMPLY LIGHTBULBS. SO THE URL I WOULD LIKE SHOULD LOOK LIKE THIS:
http://www.mysite.biz/light-bulbs/item1
Below is my current configuration my programmer has in place. What changes would I need to make to do this?? Thanks!!
# Helicon ISAPI_Rewrite configuration file # Version 3.1.0.51
RewriteEngine on RewriteRule ^(.*?\.int)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]
Edited by lightguy1 - 08 July 2008 at 10:30am
|
| Back to Top |
|
| |
Kevin Collins Groupie

Joined: 08 April 2003 Location: United States
Online Status: Offline Posts: 64
|
| Posted: 08 July 2008 at 11:24am | IP Logged
|
|
|
I don't really understand the current rule you have (with the LP and QSA stuff), but this would be a really simple way:
RewriteRule ^light-bulbs/([^/]*) moreinfo.int?itemno=$1
|
| Back to Top |
|
| |
lightguy1 Groupie

Joined: 08 July 2008
Online Status: Offline Posts: 44
|
| Posted: 08 July 2008 at 11:35am | IP Logged
|
|
|
So where would I add that into the code:
RewriteRule ^(.*?\.int)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]
Would I replace everything and it would just say:
RewriteRule ^light-bulbs/([^/]*) moreinfo.int?itemno=$1
?
Thanks
|
| Back to Top |
|
| |
Kevin Collins Groupie

Joined: 08 April 2003 Location: United States
Online Status: Offline Posts: 64
|
| Posted: 08 July 2008 at 11:50am | IP Logged
|
|
|
You could put it above the other one. Also maybe add the [L] flag at the end
RewriteRule ^light-bulbs/([^/]*) moreinfo.int?itemno=$1 [L]
But it seems like maybe your programmer had some other logic in there you might not want to break. Can you ask him or her?
|
| Back to Top |
|
| |
lightguy1 Groupie

Joined: 08 July 2008
Online Status: Offline Posts: 44
|
| Posted: 08 July 2008 at 12:18pm | IP Logged
|
|
|
I went ahead and placed it above my programmers code and it works great. Thanks.
Now I have another question, I have all of these URLs that are indexed and I want to send a 301 permanent redirect to the spiders. What is the easiest way to do that using isapi rewrite?
Indexed Urls look like this: http://www.mysite.biz/moreinfo.int?itemno=item1
I want to issue a permanent 301 and send them to these urls: http://www.mysite.biz/light-bulb/item1
Is there an easy way to do that using the .htaccess thanks?
|
| Back to Top |
|
| |
lightguy1 Groupie

Joined: 08 July 2008
Online Status: Offline Posts: 44
|
| Posted: 08 July 2008 at 12:46pm | IP Logged
|
|
|
I notice now that my part numbers that have / in the itemno are not being processed.
For example, my original url works:
http://www.mysite.biz/moreinfo.int?itemno=CF11G25/827/MED
My rewritten url, does not work:
http://www.mysite.biz/light-bulb/CF11G25/827/MED
Is there something else I need to add to my config to allow these to process???
Config below:
# Helicon ISAPI_Rewrite configuration file # Version 3.1.0.51
RewriteEngine on RewriteRule ^light-bulbs/([^/]*) moreinfo.int?itemno=$1 [L]
RewriteRule ^(.*?\.int)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]
I believe I just need to add something in the expression to process itemnumbers that contain a /
Thanks
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4701
|
| Posted: 09 July 2008 at 2:45am | IP Logged
|
|
|
Your rules should look like:
RewriteEngine on RewriteRule ^light-bulbs/(.+) moreinfo.int?itemno=$1 [L] RewriteRule ^(.*?\.int)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
lightguy1 Groupie

Joined: 08 July 2008
Online Status: Offline Posts: 44
|
| Posted: 09 July 2008 at 9:08am | IP Logged
|
|
|
Thanks, got it working!
Edited by lightguy1 - 09 July 2008 at 9:30am
|
| Back to Top |
|
| |