| Author |
|
sam Newbie

Joined: 15 June 2011 Location: India
Online Status: Offline Posts: 5
|
| Posted: 15 June 2011 at 6:53am | IP Logged
|
|
|
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
Online Status: Offline Posts: 10520
|
| Posted: 16 June 2011 at 3:49am | IP Logged
|
|
|
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
Online Status: Offline Posts: 5
|
| Posted: 16 June 2011 at 7:21am | IP Logged
|
|
|
thx a lot this is working very well .
|
| Back to Top |
|
| |
sam Newbie

Joined: 15 June 2011 Location: India
Online Status: Offline Posts: 5
|
| Posted: 16 June 2011 at 7:52am | IP Logged
|
|
|
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
Online Status: Offline Posts: 10520
|
| Posted: 17 June 2011 at 4:14am | IP Logged
|
|
|
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
Online Status: Offline Posts: 5
|
| Posted: 17 June 2011 at 5:40am | IP Logged
|
|
|
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
Online Status: Offline Posts: 10520
|
| Posted: 20 June 2011 at 4:11am | IP Logged
|
|
|
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
Online Status: Offline Posts: 5
|
| Posted: 20 June 2011 at 6:20am | IP Logged
|
|
|
thx a lot !
by adding ? its working now ...
|
| Back to Top |
|
| |