Post by rob@fineit.co.uk » Fri Jul 02, 2010 4:33 pm

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


Posts

Joined
Fri Jul 02, 2010 4:30 pm

Post by ash » Sat Apr 23, 2011 1:58 am

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>

ash
Newbie

Posts

Joined
Fri Mar 11, 2011 1:42 am
Location - Houston, TX

Post by clubd6 » Sun Apr 24, 2011 11:10 am

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

Newbie

Posts

Joined
Sun Apr 24, 2011 10:07 am

Post by waqaspai » Tue Apr 26, 2011 4:45 pm

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

Newbie

Posts

Joined
Tue Apr 26, 2011 4:41 pm

Post by planede4mer » Fri May 13, 2011 5:40 am

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

Newbie

Posts

Joined
Tue Jan 25, 2011 6:59 am

Post by jcsmithy » Fri May 13, 2011 7:07 am

Just save it in your root folder as web.config

Active Member

Posts

Joined
Fri Oct 01, 2010 9:54 pm

Post by planede4mer » Sat May 14, 2011 9:16 am

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

Newbie

Posts

Joined
Tue Jan 25, 2011 6:59 am

Post by jcsmithy » Sat May 14, 2011 3:13 pm

the .htaccess file does nothing for you, that just the equivalent of a web.config file, but for apache. Just get rid of it.

Active Member

Posts

Joined
Fri Oct 01, 2010 9:54 pm

Post by planede4mer » Tue May 17, 2011 6:39 am

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

Newbie

Posts

Joined
Tue Jan 25, 2011 6:59 am

Post by planede4mer » Sat May 21, 2011 2:15 am

Anyone got any more ideas?

Thanks,
Todd
Building8rc.com

Newbie

Posts

Joined
Tue Jan 25, 2011 6:59 am

Post by lloydmedley » Tue Jul 16, 2013 5:11 pm

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!

If I forgot to mention: it's OpenCart Vv1.5.6


New member

Posts

Joined
Tue Mar 29, 2011 11:18 pm

Post by vthompson » Fri Feb 05, 2021 11:45 am

OC 3.0.3.6 and the posted rewrite rules for IIS still work.

Newbie

Posts

Joined
Fri Feb 05, 2021 11:25 am

Post by tonyrobbo » Wed Feb 24, 2021 5:08 am

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?

Newbie

Posts

Joined
Thu Oct 12, 2017 10:18 pm
Who is online

Users browsing this forum: No registered users and 43 guests