Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

URL rewriting with Magento on IIS
 
simonr
Jr. Member
 
Total Posts:  12
Joined:  2013-08-07
 

I have a Magento installation and want to rewrite the url and remove index.php and the trailing ‘/’ from it

e.g. rewrite http://www.domain.com/index.php/ to http://www.domain.com http://www.domain.com/index.php/customer/account/login/ to http://www.domain.com/customer/account/login

etc etc. So not for these 2 urls but for all urls.

I have placed all files which are INSIDE the \magento folder in the root of my website, so the .htaccess file is in the root of my site and not in a \magento folder.

I currently have this in my web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Magento SEO: remove index.php from URL">
<match url="^(?!index.php)([^?#]*)(\\?([^#]*))?(#(.*))?" />
<conditions>
<add input="{URL}" pattern="^/(media|skin|js)/" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite\" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

With the above web.config, the urls do not seem to be rewritten at all, but are just kept as-is.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emmet1
Jr. Member
 
Total Posts:  24
Joined:  2012-12-17
 

If anyone wants to find more inforamtion about URL rewrite , you can see my topic : URL rewrite

 
Magento Community Magento Community
Magento Community
Magento Community
 
simonr
Jr. Member
 
Total Posts:  12
Joined:  2013-08-07
 

Sorry, but I don’t see how the link you provided answers my question?
I need to use urlrewrite on IIS to optimize Magento for SEO. I thought that would be possible with a few rules in the web.config

So my question stands: what rewrite rules I need to add to the web.config?

 
Magento Community Magento Community
Magento Community
Magento Community
 
simonr
Jr. Member
 
Total Posts:  12
Joined:  2013-08-07
 

Ah, that seems to be more in the direction of what I need smile

But since I’m completely new to this:

I’m thinking I need to create a rule of ‘Custom’ type.

What would i need to provide in in all fields to remove
“index.php/”

from my urls?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top