| Author |
|
pgeanous Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 6
|
| Posted: 08 July 2008 at 11:32am | IP Logged
|
|
|
i am new to this, any rule I try I keep getting pattern not matched.
my url is:
http://www.overtherestock.com/website/pc/viewCategories.asp?id=Category=1630
and I would like to change it to
http://www.overtherestock.com/website/pc/viewCategories-idCategory-1630.htm
RewriteRule viewCategories-idCategory-(.*)\.htm$ viewCategories.asp?idCategory=$1
any diection would be helpful,Thanks
|
| Back to Top |
|
| |
Kevin Collins Groupie

Joined: 08 April 2003 Location: United States
Online Status: Offline Posts: 63
|
| Posted: 08 July 2008 at 11:53am | IP Logged
|
|
|
I think you need to account for the /website/pc/ part.
So maybe...
RewriteRule website/pc/viewCategories-idCategory-(.*)\.htm$ website/pc/viewCategories.asp?idCategory=$1
|
| Back to Top |
|
| |
pgeanous Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 6
|
| Posted: 08 July 2008 at 12:02pm | IP Logged
|
|
|
I thought of that but that won't work either.
|
| Back to Top |
|
| |
michaeld Newbie

Joined: 25 June 2008 Location: United States
Online Status: Offline Posts: 9
|
| Posted: 08 July 2008 at 1:23pm | IP Logged
|
|
|
If you are always expecting a numeric value, isn't it better to have the following rule, please try and see if it works for you.
RewriteBase /
RewriteRule ^website/pc/viewCategories-idCategory-(\d+)\.htm$ website/pc/viewCategories.asp?idCategory=$1 [NC]
Edited by michaeld - 08 July 2008 at 1:24pm
|
| Back to Top |
|
| |
pgeanous Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 6
|
| Posted: 09 July 2008 at 9:22am | IP Logged
|
|
|
No luck with this rule either
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 600
|
| Posted: 09 July 2008 at 9:26am | IP Logged
|
|
|
Hi pgeanous!
Please provide your rewrite.log file. Before it, please make sure that RewriteLogLevel equals to 9.
__________________ Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
|
| Back to Top |
|
| |
pgeanous Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 6
|
| Posted: 09 July 2008 at 10:04am | IP Logged
|
|
|
I am not sure if i'am doing this right, i added RewriteLogLevel but am not getting anything in the log , but i am getting information in the error.log, just information no errors.
|
| Back to Top |
|
| |
pgeanous Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 6
|
| Posted: 09 July 2008 at 11:02am | IP Logged
|
|
|
ok I got it.
rid#21908696/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:08 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (2) init rewrite engine with requested uri /website/pc/home.asp 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:08 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:08 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (1) Htaccess process request c:\live\.htaccess 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:08 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (3) applying pattern '^website/pc/viewCategories-idCategory-(\d+)\.htm$' to uri 'website/pc/home.asp' 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:09 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (2) init rewrite engine with requested uri /website/pc/images/images6/label.gif 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:09 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:09 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (1) Htaccess process request c:\live\.htaccess 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:09 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (3) applying pattern '^website/pc/viewCategories-idCategory-(\d+)\.htm$' to uri 'website/pc/images/images6/label.gif' 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:10 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (2) init rewrite engine with requested uri /website/pc/barcodeprinters.asp 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:10 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:10 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (1) Htaccess process request c:\live\.htaccess 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:10 GMT [www.overtherestock/sid#1579908777][rid#21916984/initial] (3) applying pattern '^website/pc/viewCategories-idCategory-(\d+)\.htm$' to uri 'website/pc/barcodeprinters.asp' 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:12 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (2) init rewrite engine with requested uri /website/pc/viewCategories.asp 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:12 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:12 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (1) Htaccess process request c:\live\.htaccess 71.121.87.50 71.121.87.50 Wed, 09-Jul-2008 11:34:12 GMT [www.overtherestock/sid#1579908777][rid#21913728/initial] (3) applying pattern '^website/pc/viewCategories-idCategory-(\d+)\.htm$' to uri 'website/pc/viewCategories.asp'
|
| Back to Top |
|
| |
michaeld Newbie

Joined: 25 June 2008 Location: United States
Online Status: Offline Posts: 9
|
| Posted: 09 July 2008 at 5:01pm | IP Logged
|
|
|
There is no url request for a .htm format (for example "/website/pc/viewCategories-idCategory-1630.htm") from your log to apply the rewrite filter. The requests are in .asp format (for example "/website/pc/viewCategories.asp") . Have you changed the links on your website to reflect the .htm format? Based on the log you provided, there shouldn't be any matched at all.
|
| Back to Top |
|
| |
pgeanous Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 6
|
| Posted: 10 July 2008 at 8:20am | IP Logged
|
|
|
I must be missing something very basic, if my query string is website/pc/viewCategories.asp?idCategory=1630 what would my rewrite rule be to change it to /website/pc/viewCategories-idcategory-1630.htm
|
| Back to Top |
|
| |
michaeld Newbie

Joined: 25 June 2008 Location: United States
Online Status: Offline Posts: 9
|
| Posted: 10 July 2008 at 1:55pm | IP Logged
|
|
|
I supposed the reason why you are doing the url rewrite is for SEO purpose. But if all the links in your site has the parameter format such as website/pc/viewCategories.asp?idCategory=1630, then that doesn't really help you. What you need rather is to change all the links in your site to something like /website/pc/viewCategories-idcategory-1630.htm and have the url rewrite redirect internally to the asp parameter format, not a 301 redirect. But I do not know your needs, so if you insist on doing the other way around, then I would do it this way:
RewriteBase / RewriteCond %{REQUEST_FILENAME} ^.*/viewCategories\.asp$ [NC] RewriteCond %{QUERY_STRING} ^idCategory=(\d+)$ RewriteRule (.*) website/pc/viewCategories-idCategory-%1.htm [R=301,NC,L]
This is assuming that you have the actual htm file viewCategories-idCategory-1630.htm located in the website/pc/ subfolder. I'm new to this too, so my code may not be the best, some people in this forum might probably have a better suggestion for you.
|
| Back to Top |
|
| |