Page 1 of 1
web.config rewrite rules
Posted: Fri Jul 02, 2010 4:33 pm
by rob@fineit.co.uk
Hi,
Does anyone have a web.config file for IIS that will rewrite SEO URLS in the same way .htaccess does for unix servers?
Thanks
Re: web.config rewrite rules
Posted: Sat Apr 23, 2011 1:58 am
by ash
I understand this is an old post but I figured I'd response in case somebody else is searching...
This is web.config I use and it seems to work for v1.4.9.4
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example\.com$" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://www.example.com/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?_route_={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Re: web.config rewrite rules
Posted: Sun Apr 24, 2011 11:10 am
by clubd6
SEO URL problem:
I just installed version 1.4.9.4, I have mod-rewrite is installed, removed .txt from the htaccess sheet, checked "Use SEO url's but it is not working. my cart is here
www.petusa.net/cart can anyone help me with this problem?
Thanks in advance
Re: web.config rewrite rules
Posted: Tue Apr 26, 2011 4:45 pm
by waqaspai
I see that your website is working fine with seo friendly urls .
I have renamed ms configed and apache module is also insntalled.
can you please guide me what you did ?
my site is located at
www.pakistangifthouse.com/gifts-to-pakistan
Re: web.config rewrite rules
Posted: Fri May 13, 2011 5:40 am
by planede4mer
Hello, can some one explain were to add the IIS file information that is above. I new to this so I need a little hand holding.
Thanks so Much
Todd Pearson
Building8 RC
Re: web.config rewrite rules
Posted: Fri May 13, 2011 7:07 am
by jcsmithy
Just save it in your root folder as web.config
Re: web.config rewrite rules
Posted: Sat May 14, 2011 9:16 am
by planede4mer
jcsmithy wrote:Just save it in your root folder as web.config
Ok thanks I can do that. Also do I need to change the htaccess file name as well and check the box in the admin panel?
Thanks again for all the support...
Todd
Building8rc.com
Re: web.config rewrite rules
Posted: Sat May 14, 2011 3:13 pm
by jcsmithy
the .htaccess file does nothing for you, that just the equivalent of a web.config file, but for apache. Just get rid of it.
Re: web.config rewrite rules
Posted: Tue May 17, 2011 6:39 am
by planede4mer
Hmmm, I can not get it to work properly. After installing the web.config file and then selecting the use seo in the admin settings I get can't show web page 404 err on the site. It is showing the seo url in the address bar but we can not see the page? Again thanks for all the help and support.
Todd
Building RC Products
shop.b8rc.com
Re: web.config rewrite rules
Posted: Sat May 21, 2011 2:15 am
by planede4mer
Anyone got any more ideas?
Thanks,
Todd
Building8rc.com
Re: web.config rewrite rules
Posted: Tue Jul 16, 2013 5:11 pm
by lloydmedley
ash wrote:I understand this is an old post but I figured I'd response in case somebody else is searching...
This is web.config I use and it seems to work for v1.4.9.4
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example\.com$" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://www.example.com/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?_route_={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Thanks for posting this, worked a treat!
Re: web.config rewrite rules
Posted: Fri Feb 05, 2021 11:45 am
by vthompson
OC 3.0.3.6 and the posted rewrite rules for IIS still work.
Re: web.config rewrite rules
Posted: Wed Feb 24, 2021 5:08 am
by tonyrobbo
Good that it still works, but how would I alter this if I had opencart in a subfolder: example.com/shop as I can't seem to get it working?