Jump to content

URL Rewrite IIS 7.7


intrafusion

Recommended Posts

I'm setting up my first prestashop site and would like to enable URL friendly URLS but I am on a windows 2008 server.

 

So far, on the server I created a web config, and tried to convert .htaccess files that I've seen posted on other listings...

 

I havent studied up on regex before, so I was wondering if anyone could share some rules so that the rest of my site works...

 

having trouble with pages like:

/prices-drop

/order

/order?step=1

/best-sales

 

So basically I have products pages working, category pages, images.

 

 

The below is all working, and I am happy to share:

 

 

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<system.webServer>

<rewrite>

<outboundRules>

<preConditions>

<preCondition name="ResponseIsHtml1">

<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />

</preCondition>

</preConditions>

</outboundRules>

<rules>

<clear />

<rule name="product">

<match url="([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$" />

<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

<action type="Rewrite" url="product.php?id_product={R:2}" />

</rule>

<rule name="product home">

<match url="([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$" />

<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

<action type="Rewrite" url="product.php?id_product={R:1}{R:3}" />

</rule>

<rule name="images">

<match url="([a-z0-9]+)-([a-z0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*).jpg" />

<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

<action type="Rewrite" url="/img/p/{R:1}-{R:2}{R:3}.jpg" appendQueryString="false" />

</rule>

<rule name="image1">

<match url="([0-9]+)-([0-9]+)/([_a-zA-Z0-9-]*).jpg" />

<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

<action type="Rewrite" url="/img/p/{R:1}-{R:2}.jpg" />

</rule>

<rule name="Category" enabled="true">

<match url="^([0-9]+)\-([a-zA-Z0-9-]*)" />

<conditions logicalGrouping="MatchAll" trackAllCaptures="false">

</conditions>

<action type="Rewrite" url="category.php?id_category={R:1}" />

</rule>

</rules>

</rewrite>

</system.webServer>

</configuration>

 

 

thanks

steve

Link to comment
Share on other sites

  • 3 months later...
  • 10 months later...
  • 1 month later...

I'm on a windows server and can't enable the friendly URLs either. Here is my server info:

Server information: Windows NT build 7601 (Windows Server 2008 R2 Web Server Edition Service Pack 1) i586

Server software version: Microsoft-IIS/7.5

PHP version: 5.3.13

Memory limit: 128M

Max execution time: 300

 

We have enabled the url rewrite extension on the server. However, I believe there is a default rule that needed to be created. This is what our rewrite template looks like on the server:

index.php?id_product={R:1}&controller={R:2}&id_lang={R:3}

 

But when I enable the friendly URLs all I get are 404 error pages on all pages on the site and all images disappear. Can anyone help with this issue whether it's configuration or if there is a bug in the code? I have noticed some other posts about friendly urls on the forums and really need to get this working properly before I move into further development on the site.

 

I'm not at all a server administrator so any help would be greatly appreciated.

Link to comment
Share on other sites

Thanks yes, I've ran across some other posts dealing with that issue and have found a solution in the post below for anyone else having the same problems.

 

http://www.prestashop.com/forums/topic/60163-solved-friendly-urls-iiswindows-server/

 

I'm waiting for my server admin to get it applied so once I test and confirm it works I will post back here the results.

Link to comment
Share on other sites

  • 1 year later...

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...