Thursday, May 16, 2013

Magento remove index.php from URL in IIS and Apache for magento

go to Magento admin panel –> system –>configuration –>web –>Search Engines Optimization –> Use Web Server Rewrites –> Yes
create web.config file under magento root folder
<?xml version="1.0" encoding="UTF-8"?>
<configuration>    <system.webServer>        <rewrite> 
   <rule name="Magento SEO: remove index.php from URL">
<match url="^(?!index.php)([^?#]*)(\?([^#]*))?(#(.*))?" />
<action type="Rewrite" url="index.php/{R:0}" />
                <rule name="Remove index.php Rule" stopProcessing="true"> 
                    <match url=".*" ignoreCase="false" /> 
                        <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" /> 
                    <action type="Rewrite" url="index.php" /> 
---------------------------------.HTACCESS for APACHE--------------------------------------------
if not work  please below code in htaccess
RewriteBase / 
RewriteCond %{HTTP_HOST} ^yoursitename\.domainExtantion (com, net, in) 
RewriteRule ^(.*)$ [R=permanent,L]
RewriteEngine on 
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [NC,L]

1 comment:

  1. It's the best time to make a few plans for the long
    run and it's time to be happy. I've read this
    put up and if I may I desire to counsel you some fascinating things or
    tips. Maybe you could write next articles relating to this article.
    I want to read even more things approximately it!