Jump to content

URL rewriting in IIS 6 / IIS redirecting


Recommended Posts

I have found multiple possible solutions for rewriting on a windows machine with IIS.
But none worked...

Does anybody have an example rewrite (.ini) rulefile for me to use with Prestashop and IIS?
Somehow I dont get it to work.

The default generated htaccess rewrite rules dont work for IIS.

Thanks for your answers in advance.

Kind regards,
Richard

Link to comment
Share on other sites

Hello all!! found a good solution. If you create redirects for Windows 2003 / IIS6 and IIS7: use these... works for me..

RewriteLog C:\temp\rewriteLog3.out
#RewriteLogLevel 3
RewriteFilterPriority HIGH


RewriteRule ^/(\d+)-(.*)\.html$ /product.php?id_product=$1 [L]
RewriteRule ^/(.*)/(\d+)-(.*)\.html$ /product.php?id_product=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(\d+)\-(category|medium)/(.*)\.jpg$ /img/c/$1-$2.jpg [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)/(.*)\.jpg$ /img/p/$1.jpg [L]

RewriteRule ^/content/(\d+)\-(.*)$ /cms.php?id_cms=$1 [L]

RewriteRule ^/(\d+)\-(.*)$ /category.php?id_category=$1 [L]

Link to comment
Share on other sites

EDIT in CODE:

Found an issue that the rewriting of the pager didnt work. QSA doesnt work well in IIS somehow.
Here is the new IIS rewrite code:

========


RewriteRule ^/(\d+)-(.*)\.html$ /product.php?id_product=$1 [L]
RewriteRule ^/(.*)/(\d+)-(.*)\.html$ /product.php?id_product=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(\d+)\-(category|medium)/(.*)\.jpg$ /img/c/$1-$2.jpg [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)/(.*)\.jpg$ /img/p/$1.jpg [L]

RewriteRule ^/content/(\d+)\-(.*)$ /cms.php?id_cms=$1 [L]

# added the below line for paging rewriting
RewriteRule ^/(\d+)\-(.*)\?p\=(\d+)$ /category.php?id_category=$1&p;=$3 [L]
RewriteRule ^/(\d+)\-(.*)$ /category.php?id_category=$1 [L]



=========

Kind regards,
Richard

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Hi guys,

I been looking for the solution for this issue for few days and I would like to share something with you guys. There are 2 solutions to address this issue.

1) ISAPI_Rewrite
This component enabled .htaccess in IIS, no changes on your code at all. Cost is USD25.
More info: http://www.helicontech.com/isapi_rewrite/

2) IIS 7 URL Rewrite Module
This is an add-on that you need to manually install in your IIS 7. What it does is it will convert your existing PHP's RewriteRule code to a web.config file. You will need to place the newly generated web.config file in your PrestaShop root folder.
More info: http://learn.iis.net/page.aspx/460/using-url-rewrite-module/

Hope this help :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...