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: Pattern not matched Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
pgeanous
Newbie
Newbie


Joined: 08 July 2008
Online Status: Offline
Posts: 6
Posted: 08 July 2008 at 11:32am | IP Logged Quote pgeanous

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


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

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


Joined: 08 July 2008
Online Status: Offline
Posts: 6
Posted: 08 July 2008 at 12:02pm | IP Logged Quote pgeanous

I thought of that but that won't work either.
Back to Top View pgeanous's Profile Search for other posts by pgeanous
 
michaeld
Newbie
Newbie


Joined: 25 June 2008
Location: United States
Online Status: Offline
Posts: 9
Posted: 08 July 2008 at 1:23pm | IP Logged Quote michaeld

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


Joined: 08 July 2008
Online Status: Offline
Posts: 6
Posted: 09 July 2008 at 9:22am | IP Logged Quote pgeanous

No luck with this rule either
Back to Top View pgeanous's Profile Search for other posts by pgeanous
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 600
Posted: 09 July 2008 at 9:26am | IP Logged Quote Vyacheslav

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 View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
pgeanous
Newbie
Newbie


Joined: 08 July 2008
Online Status: Offline
Posts: 6
Posted: 09 July 2008 at 10:04am | IP Logged Quote pgeanous

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


Joined: 08 July 2008
Online Status: Offline
Posts: 6
Posted: 09 July 2008 at 11:02am | IP Logged Quote pgeanous

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


Joined: 25 June 2008
Location: United States
Online Status: Offline
Posts: 9
Posted: 09 July 2008 at 5:01pm | IP Logged Quote michaeld

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


Joined: 08 July 2008
Online Status: Offline
Posts: 6
Posted: 10 July 2008 at 8:20am | IP Logged Quote pgeanous

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


Joined: 25 June 2008
Location: United States
Online Status: Offline
Posts: 9
Posted: 10 July 2008 at 1:55pm | IP Logged Quote michaeld

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

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