IIS7 and Prestashop with v3

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 05 Jun 2014, 09:18

IIS7 and Prestashop with v3

05 Jun 2014, 09:21

hello
I purchased the plugin recently, to use friendly rewrites with my prestashops, I initially got this working, however I had an issue with my server and the plugin so I had to uninstall and reinstall the plugin due to a dll problem with it one night, since then I don't think it is working correctly.

This is my prestashop .htaccess

(I have changed the host to something as its not a public site yet)

version is latest 0104 x64
windows 2008 R2
IIS 7
I have looked at error.log and it says the isapi is loaded.
my http.conf has my registration data in and the RewriteLogLevel 9
LogLevel debug

But I don't seem to have anything else errorwise or logging.. which makes me think its not being used on my websites.

many thanks
Olie



# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>

# Disable Multiviews
Options -Multiviews

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule . - [E=REWRITEBASE:/shop/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_HOST} ^www.something.co.uk$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /shop/index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

User avatar
Posts: 3
Joined: 05 Jun 2014, 09:18

Re: IIS7 and Prestashop with v3

05 Jun 2014, 10:27

little bit more info.
I do have plesk installed on my server, but when I run webmail for my domains - this is using helicon fine, and I get error logs in the file of the v3 installation.

Now I wonder why it is not being used for the other websites even though they have a .htaccess?

is web.config stopping it?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: IIS7 and Prestashop with v3

06 Jun 2014, 11:15

Hello,

What does rewrite say when you enable logging and run a testing request?

Regards

User avatar
Posts: 3
Joined: 05 Jun 2014, 09:18

Re: IIS7 and Prestashop with v3

10 Jun 2014, 17:21

Hello,
when i run the website it doesn't use the rewrite for some reason so no logs are generated, but if i run my webmail (horde) that invokes debugging in the logs, and i get a few lines.

these are just a sample from the webmail .

Error.log
[10/06/2014 17:41:25] ISAPI Filter loaded. Version 3.1.0.104. Windows 6.1 (Build 7601 ServicePack:1) ProductType SERVER. CPU type INTEL NumberOfProcessors 4.

rewrite.log

[rid#21899304/initial] (4) RewriteCond: input='C:\Program Files (x86)\Parallels\Plesk\Webmail\horde\horde\themes\default\graphics\favicon.ico' pattern='!!-f' => not-matched
[rid#21899304/initial] (2) internal redirect with /themes/default/graphics/favicon.ico [INTERNAL REDIRECT]

so it is doing something.

Ive checked in the IIS setup and the dlls are registered locally for each website, i cant see what is different between the horde IIS instance and the website hosting

thanks

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: IIS7 and Prestashop with v3

11 Jun 2014, 00:03

This is strange... so it seems like the request go around ISAPI_Rewrite3. This makes me think that Prestashop gets into the mix earlier and hijacks everything.
Try to put the following in your httpd.conf:

Code: Select all
RewriteEngine on
NotificationType=PREPROC_HEADERS


Regards

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 14 guests