Richard Groen Posted November 8, 2009 Share Posted November 8, 2009 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 More sharing options...
Richard Groen Posted November 9, 2009 Author Share Posted November 9, 2009 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 3RewriteFilterPriority HIGHRewriteRule ^/(\d+)-(.*)\.html$ /product.php?id_product=$1 [L]RewriteRule ^/(.*)/(\d+)-(.*)\.html$ /product.php?id_product=$2 [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^/(\d+)\-(category|medium)/(.*)\.jpg$ /img/c/$1-$2.jpg [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^/(.*)/(.*)\.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 More sharing options...
Richard Groen Posted November 10, 2009 Author Share Posted November 10, 2009 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 More sharing options...
lipingziy Posted February 6, 2010 Share Posted February 6, 2010 i have the same problem,who can resolve this ., Link to comment Share on other sites More sharing options...
tanweeseng Posted March 31, 2010 Share Posted March 31, 2010 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_RewriteThis 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 ModuleThis 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 More sharing options...
tanweeseng Posted March 31, 2010 Share Posted March 31, 2010 Sample web.config generated by IIS 7 URL Rewrite Module-------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now