This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: URL Rewriting Not working
Author
Message |
sam
Newbie


Joined: 15 June 2011
Location: India
Posts: 5
Posted: 15 June 2011 at 6:53am

hi all ,

i have implemented URL rewrite using ISAPI_Rewriter 2.8

below is the URL of the test page.

http://www.eish2o.co.za/departmenttest.aspx

and below is the code written in httpd.ini.

Rewrite rule : RewriteRule ^.*-deptid-([0-9]+).aspx
Catalog.aspx?DepartmentID=$1 [L]


The Actual URL :http://www.eish2o.co.za/Catalog.aspx?
DepartmentID=1

i need to rewrite the above url as in following format

http://www.eish2o.co.za/Water-Dispensers-Fridges-&-Ice-
Makers-deptid-2.aspx

but the url re writing is not working.


can you please help ?



Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 16 June 2011 at 3:49am

Please try to have it like this:

[ISAPI_Rewrite]
RewriteRule /.*-deptid-(\d+)\.aspx /Catalog.aspx\?DepartmentID=$1 [I,L]

BTW, please notice that the number in SEO-friendly URL (2) is not the same as the id in the real URL (1). Is it just a mistake or maybe it
contributes to the error?

__________________
Regards,
Anton
Back to Top
 
sam
Newbie


Joined: 15 June 2011
Location: India
Posts: 5
Posted: 16 June 2011 at 7:21am

thx a lot this is working very well .

Back to Top
 
sam
Newbie


Joined: 15 June 2011
Location: India
Posts: 5
Posted: 16 June 2011 at 7:52am

i am trying further to re-write url with multiple query
string. but i am not able to find proper rule for that.

i need to rewrite the following URL .

Original URL :

http://www.eish2o.co.za/catalog.aspx?
DepartmentID=1&CategoryID=1

Required url :
http://www.eish2o.co.za/Water-Filtration-&-Purification-
Systems-Water-Filter-Bottles-deptid1-catid1.aspx

httpd.ini

RewriteRule /.*-deptid(\d+)-catid(\d+)\.aspx
/Catalog.aspx\?DepartmentID=$1&CategoryID=$2 [I,L]

i am not able to get where exactly the problem is.

please help me.

thanks .
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 17 June 2011 at 4:14am

Really strange as the rule looks absolutely correct.
Is your first rule still working?
What error do you get for the second rule?
Can you access the original URL directly?

__________________
Regards,
Anton
Back to Top
 
sam
Newbie


Joined: 15 June 2011
Location: India
Posts: 5
Posted: 17 June 2011 at 5:40am

hi Anton
Thanks for replying.

Yes my first rule is working fine .(with single querystring.)

If i apply 2nd rule (multiple query string) its showing "Bad Request" error.

Yes. i can access the Original url directly .

My original URL Link as below.
http://www.eish2o.co.za/catalog.aspx?DepartmentID=1&CategoryID=3

i need to write something like this.

http://www.eish2o.co.za/Water-Filtration-&-Purification-Systems-Ultraviolet-Water-Purifiers-deptid1-
catid10.aspx


please reply me .

Thanks in advance.








Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 20 June 2011 at 4:11am

Shouldn't it be ...catid3.aspx ? Or the numbers in SEO and original URLs don't match?
And please try to figure out why it says "Bad request" as it happens before the URL comes to ISAPI_Rewrite. Try using some debug tools.

__________________
Regards,
Anton
Back to Top
 
sam
Newbie


Joined: 15 June 2011
Location: India
Posts: 5
Posted: 20 June 2011 at 6:20am

thx a lot !

by adding ? its working now ...






Back to Top
 

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

Printable version Printable version
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 cannot vote in polls in this forum