upgraded to v3

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 14
Joined: 27 Apr 2013, 17:11

upgraded to v3

08 Apr 2014, 20:38

Ive moved a client to a new host and they use v3.
My old host used v2 and so my httpd.ini file isnt working.

Please can someone help me rewrite this for v3?


[ISAPI_Rewrite]
RewriteCond %HTTPS (on)?
RewriteCond Host: (?!www\.)(.+)
RewriteRule (.*) http(?$1s:)\://www.$2$3 [I,RP]

#product rules

RewriteRule /P(\d+).*\-C(\d+)\.asp /productdetails.asp\?ProductID=$1&SubCatagoryID=$2 [I,L]
RewriteRule /P(\d+)-pg(\d+)(.*)\.asp /productdetails.asp\?ProductID=$1 [I,L]
RewriteRule /P(\d+)(.*)\.asp /productdetails.asp\?ProductID=$1 [I,L]


#category rules
RewriteRule /d(\d+)-pg(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule /d(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,L]

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: upgraded to v3

09 Apr 2014, 05:08

Hello,

Please use the following in your .htaccess under the root of the site:

RewriteBase /
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+)
RewriteRule (.*) http(?%1s:)\://www.$1/$2 [R=301]

#product rules

RewriteRule ^P(\d+).*\-C(\d+)\.asp$ /productdetails.asp?ProductID=$1&SubCatagoryID=$2 [NC,L]
RewriteRule ^P(\d+)-pg(\d+)(.*)\.asp$ /productdetails.asp?ProductID=$1 [NC,L]
RewriteRule ^P(\d+)(.*)\.asp$ /productdetails.asp?ProductID=$1 [NC,L]


#category rules
RewriteRule /d(\d+)-pg(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule /d(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,L]

User avatar
Posts: 14
Joined: 27 Apr 2013, 17:11

Re: upgraded to v3

09 Apr 2014, 06:36

Hi Anton,
thanks for the reply. Ive done what you said and I now get an error:

Oops! Google Chrome could not find www.

I should mention that this is running in an account with a temporary URL at the moment.
the URL for the site until it is completed will be something like:

http://mywebsitedomain.co.uk.server.hos ... domain.com

right now I cant access the website at all.

User avatar
Posts: 14
Joined: 27 Apr 2013, 17:11

Re: upgraded to v3

09 Apr 2014, 16:26

ive edited the .htaccess to:

=======================================================================================================================

RewriteEngine on


#product rules

RewriteRule ^P(\d+).*\-C(\d+)\.asp$ /productdetails.asp?ProductID=$1&SubCatagoryID=$2 [NC,L]
RewriteRule ^P(\d+)-pg(\d+)(.*)\.asp$ /productdetails.asp?ProductID=$1 [NC,L]
RewriteRule ^P(\d+)(.*)\.asp$ /productdetails.asp?ProductID=$1 [NC,L]


#category rules
RewriteRule /d(\d+)-pg(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule /d(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,L]

=======================================================================================================================


This has got some of the site working but some of it still isnt working. the products pages seem to be loading although im having a problem with them. But the Category pages are still not working at all?

User avatar
Posts: 14
Joined: 27 Apr 2013, 17:11

Re: upgraded to v3

09 Apr 2014, 20:03

I noticed that the ones that worked had ^ rather than / in front of them,
so I changed:

#category rules
RewriteRule /d(\d+)-pg(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule /d(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,L]

to

#category rules
RewriteRule ^d(\d+)-pg(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule ^d(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,L]


and it worked, thank you so much for your help...

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: upgraded to v3

10 Apr 2014, 04:55

Hello,

I'm sorry, I've made a mistake in the rule. Please try it like this:

RewriteBase /
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+)
RewriteRule (.*) http(?%1s:)://www.%{HTTP_HOST}/$1 [R=301]

#product rules

RewriteRule ^P(\d+).*\-C(\d+)\.asp$ /productdetails.asp?ProductID=$1&SubCatagoryID=$2 [NC,L]
RewriteRule ^P(\d+)-pg(\d+)(.*)\.asp$ /productdetails.asp?ProductID=$1 [NC,L]
RewriteRule ^P(\d+)(.*)\.asp$ /productdetails.asp?ProductID=$1 [NC,L]


#category rules
RewriteRule /d(\d+)-pg(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule /d(\d+)(.*?)/? /Products.asp\?SubCatagoryID=$1 [I,L]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests