Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Help me rewrite Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
lightguy1
Groupie
Groupie


Joined: 08 July 2008
Online Status: Offline
Posts: 44
Posted: 08 July 2008 at 10:10am | IP Logged Quote lightguy1

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 View lightguy1's Profile Search for other posts by lightguy1
 
Kevin Collins
Groupie
Groupie


Joined: 08 April 2003
Location: United States
Online Status: Offline
Posts: 64
Posted: 08 July 2008 at 11:24am | IP Logged Quote Kevin Collins

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 View Kevin Collins's Profile Search for other posts by Kevin Collins
 
lightguy1
Groupie
Groupie


Joined: 08 July 2008
Online Status: Offline
Posts: 44
Posted: 08 July 2008 at 11:35am | IP Logged Quote lightguy1

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 View lightguy1's Profile Search for other posts by lightguy1
 
Kevin Collins
Groupie
Groupie


Joined: 08 April 2003
Location: United States
Online Status: Offline
Posts: 64
Posted: 08 July 2008 at 11:50am | IP Logged Quote Kevin Collins

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 View Kevin Collins's Profile Search for other posts by Kevin Collins
 
lightguy1
Groupie
Groupie


Joined: 08 July 2008
Online Status: Offline
Posts: 44
Posted: 08 July 2008 at 12:18pm | IP Logged Quote lightguy1

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 View lightguy1's Profile Search for other posts by lightguy1
 
lightguy1
Groupie
Groupie


Joined: 08 July 2008
Online Status: Offline
Posts: 44
Posted: 08 July 2008 at 12:46pm | IP Logged Quote lightguy1

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 View lightguy1's Profile Search for other posts by lightguy1
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4701
Posted: 09 July 2008 at 2:45am | IP Logged Quote Anton

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 View Anton's Profile Search for other posts by Anton
 
lightguy1
Groupie
Groupie


Joined: 08 July 2008
Online Status: Offline
Posts: 44
Posted: 09 July 2008 at 9:08am | IP Logged Quote lightguy1

Thanks, got it working!

Edited by lightguy1 - 09 July 2008 at 9:30am
Back to Top View lightguy1's Profile Search for other posts by lightguy1
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum