Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Apache rules to ISAPI Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 20 April 2010 at 4:33am | IP Logged Quote Matt Morrison

< http-equiv="Content-" content="text/; charset=utf-8">< name="ProgId" content="Word.">< name="Generator" content="Microsoft Word 12">< name="Originator" content="Microsoft Word 12"><link rel="File-List" href="file:///C:%5CUsers%5CMatt%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" target="_blank"><link rel="themeData" href="file:///C:%5CUsers%5CMatt%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" target="_blank"><link rel="colorSchemeMapping" href="file:///C:%5CUsers%5CMatt%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" target="_blank">< style>

Hello,


I have installed a zen cart package on IIS6 and I�m trying to use a module that requires URL rewriting, I already have ISAPI rewrite version 2 installed and being used on that server and because the rules the module provider provided are for apache I thought converting those rules and adding them to my ISAPI rewrite v2 setup would work?  Only issue is I have absolutely no idea how to convert those rules, can anyone else help me please?  Here are the rules for apache:

 

RewriteEngine On

 

# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$

# Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/admin.* [NC]

# Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors.* [NC]

# Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]

RewriteCond %{REQUEST_URI} !/frontend.* [NC]

# Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) index.php?%{QUERY_STRING} [L]


Thanks, Matt.

Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 20 April 2010 at 7:38am | IP Logged Quote Anton

Firstly, you may consider to upgrade to more powerful and Apache-compatible version of ISAPI_Rewirte - v3.
In v3 the above config will work without modifications.

Or, if it's not possible, please try to following config:

[ISAPI_Rewrite]
RewriteRule /(?!(?:admin|editors|cpanel|frontend)).* $0 [I,L]
RewriteRule /(?!.*\.[a-zA-Z]{2,4}).*$ $0 [I,L]

# Handle all other URIs using Zen Cart (index.php)
RewriteRule .*\?(.*) index.php?$1 [L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 20 April 2010 at 8:31am | IP Logged Quote Matt Morrison

Thank you for your help.

I did upgrade but reverted back because I have no idea how to convert my rules to the new syntax, do you provide a service for that?  I used to have a developer that did this part of things but he's not with me anymore and I haven't got a clue!

I tried your rules but they made all my other rules not work, here is an example of the type of rules that I have in there alread:

RewriteRule /(.*)/l([0-9]*).aspx /Site/Pages/List/Default.aspx\?lst=$2&PageNo=1 [U]
RewriteRule /(.*)/l([0-9]*)_p([0-9]*).aspx /Site/Pages/List/Default.aspx\?lst=$2&PageNo=$3 [U]

Thanks again for your help, Matt.

Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 21 April 2010 at 5:10am | IP Logged Quote Anton

"I have no idea how to convert my rules to the new syntax" - hte thing is that ISAPI_Rewrite 3 has the same syntax as Apache mod_rewrite, so
this syntax should work as is:

RewriteEngine On

# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$

# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/admin.* [NC]

# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors.* [NC]

# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) index.php?%{QUERY_STRING} [L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 21 April 2010 at 7:33am | IP Logged Quote Matt Morrison

Hi,

Thanks for the info.  What I mean is I understand that ISAPI Rewrite 3 is compatible with Apache and I don't need to convert the rules but my existing rules (not the Apache stuff) that are in ISAPI v2 syntax need converting to v3 and that's the bit I can't do; do you provide a service for that?

Thanks, Matt.

Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 21 April 2010 at 8:17am | IP Logged Quote Anton

Sure, please show the v2 rules you have and i'll convert them for you.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 28 April 2010 at 5:12pm | IP Logged Quote Matt Morrison

Hi, sorry for the delay...

Thank you very much, although there are a few, should I send them via email rather than paste them all in here?

Thanks,
Matt.
Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 29 April 2010 at 2:45am | IP Logged Quote Anton

That actually doesn't matter. If there are not hundreds of them, you may put them here.
Or send them to support@helicontech.com

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 29 April 2010 at 4:07am | IP Logged Quote Matt Morrison

Hi Anton,

There aren't hundreds but I have opted to send them via email anyway, we could always post a few examples here afterwards for other people to  get some ideas about upgrading their old rules if you like.

Thanks again, email on its way...
Matt.
Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 20 May 2010 at 2:35am | IP Logged Quote Matt Morrison

Hi,

All those rules work like a charm so thank you very much!  I am however having problems with one of my sites that had the apache rules.  I copied them in with no changes as suggested and although the URL looks right in the address bar, it doesn't arrive at the correct page, it arrives at the homepage?

Here is an example URL that looks correct but arrives at the homepage: http://www.enchantedportal.co.uk/aromatherapy

And here is the query string URL before it was had rewrite: http://www.enchantedportal.co.uk/index.php?main_page=index&cPath=21

Here are the apache rules:

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.73

RewriteEngine On

# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$

# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/admin.* [NC]

# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors.* [NC]

# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) index.php?%{QUERY_STRING} [L]

Thank you in advance for your help with this.
Matt.
Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 20 May 2010 at 3:12am | IP Logged Quote Anton

Let's try a small fix in the last line:

RewriteRule (.*) index.php [L,QSA]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 20 May 2010 at 4:26am | IP Logged Quote Matt Morrison

Thanks, I've applied that, seems to do exactly the same thing.

__________________
Cheers, Matt Morrison
Opal Logic Ltd
Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 20 May 2010 at 4:42am | IP Logged Quote Anton

Ok, then could you show me the rewrite.log for this request.
Also, please tell whether it happens for other requests of this pattern.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 20 May 2010 at 4:53am | IP Logged Quote Matt Morrison

hmmm, there is nothing in the log.

I have put this into the config for the website:
RewriteLog C:\Program Files\Helicon\ISAPI_Rewrite3\Rewrite.log

I have looked at the log and there is nothing in it again?  Do I need to restart IIS?

Also, this is the only website that uses apache rules so I have nothing else to compare the rule syntax against to see if others are operating correctly or not; the v3 rules you helped me with for my other websites work fine.


__________________
Cheers, Matt Morrison
Opal Logic Ltd
Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 20 May 2010 at 7:05am | IP Logged Quote Anton

The log may be empty due to insufficient permissions, please check.
Let's try the whole config with small fixes:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !^.*\.[a-zA-Z]{2,4}$
RewriteCond %{REQUEST_URI} !^/(?:admin|editors|cpanel|frontend).* [NC]

# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) index.php [QSA,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 20 May 2010 at 1:48pm | IP Logged Quote Matt Morrison

I have checked and the everyone group has write, modify permissions etc on the rewrite.log file so should work no problem.  Here are the rules I have (do I need to put the lof rule in the main config file or the actual website config?)

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.73

RewriteEngine On
RewriteBase /

# Log rewrites
RewriteLog C:\Program Files\Helicon\ISAPI_Rewrite3\Rewrite.log

# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])
RewriteCond %{REQUEST_URI} !^.*\.[a-zA-Z]{2,4}$

# Don't rewrite cPanel directories, admin directory or editors directory
RewriteCond %{REQUEST_URI} !^/(?:admin|editors|cpanel|frontend).* [NC]

# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) index.php [QSA,L]


__________________
Cheers, Matt Morrison
Opal Logic Ltd
Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Matt Morrison
Groupie
Groupie


Joined: 01 October 2007
Location: United Kingdom
Online Status: Offline
Posts: 51
Posted: 20 May 2010 at 1:50pm | IP Logged Quote Matt Morrison

So sorry I forgot to mention that still no logs and the URL looks rewritten but still only goes to the homepage

__________________
Cheers, Matt Morrison
Opal Logic Ltd
Back to Top View Matt Morrison's Profile Search for other posts by Matt Morrison Visit Matt Morrison's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 21 May 2010 at 3:25am | IP Logged Quote Anton

So, no changes with the new config?..
Then I guess we'll both benefit from RDP or online meeting whatever is more suitable for you.
Please provide the proper credentials to support@helicontech.com and put 'for Anton' into the title and reference to this forum thread into
the text. Also please specify the prefered software, time and date.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

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