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
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: URL Rewriting Not working Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sam
Newbie
Newbie


Joined: 15 June 2011
Location: India
Online Status: Offline
Posts: 5
Posted: 15 June 2011 at 6:53am | IP Logged Quote sam

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 16 June 2011 at 3:49am | IP Logged Quote Anton

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


Joined: 15 June 2011
Location: India
Online Status: Offline
Posts: 5
Posted: 16 June 2011 at 7:21am | IP Logged Quote sam

thx a lot this is working very well .

Back to Top View sam's Profile Search for other posts by sam
 
sam
Newbie
Newbie


Joined: 15 June 2011
Location: India
Online Status: Offline
Posts: 5
Posted: 16 June 2011 at 7:52am | IP Logged Quote sam

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 17 June 2011 at 4:14am | IP Logged Quote Anton

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


Joined: 15 June 2011
Location: India
Online Status: Offline
Posts: 5
Posted: 17 June 2011 at 5:40am | IP Logged Quote sam

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 20 June 2011 at 4:11am | IP Logged Quote Anton

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


Joined: 15 June 2011
Location: India
Online Status: Offline
Posts: 5
Posted: 20 June 2011 at 6:20am | IP Logged Quote sam

thx a lot !

by adding ? its working now ...






Back to Top View sam's Profile Search for other posts by sam
 

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