Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting Gallery3 .htaccess mod_rewrite code to IIS URL Rewrite in Web.config
    primarykey
    data
    text
    <p>I have a website on which i have installed Gallery3. The url is </p> <pre><code> http://techblog.lalsofttech.com/gallery/ </code></pre> <p>But when i open the "test album", in the url there is index.php</p> <pre><code>http://techblog.lalsofttech.com/gallery/index.php/test </code></pre> <p>Now what i want is to remove the index.php from the url and want the url to look like this</p> <pre><code> http://techblog.lalsofttech.com/gallery/test </code></pre> <p>Since my shared server space is a windows platform with IIS 7, i cant use the .htaccess file. Since my server got Microsoft URL Rewrite module installed i need to write the rewrite rule in web.config file.</p> <p>This is the code for hiding the index.php in the .htaccess file</p> <pre><code> &lt;IfModule mod_rewrite.c&gt; Options +FollowSymLinks RewriteEngine On RewriteBase /gallery RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L] RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L] RewriteRule ^index.php/(.*) $1 [QSA,R,L] &lt;/IfModule&gt; </code></pre> <p>I tried to convert this by installing the Microsoft URL Rewrite module in my localhost. </p> <p>Except the "RewriteBase /gallery" all the other codes get converted ."RewriteBase /gallery is not converted because it is not supported by IIS" is the error message i got. And this is the converted code.</p> <pre><code>&lt;rewrite&gt; &lt;rules&gt; &lt;rule name="Imported Rule 1" stopProcessing="true"&gt; &lt;match url="^(.*)$" ignoreCase="false" /&gt; &lt;conditions&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="index.php?kohana_uri={R:1}" appendQueryString="true" /&gt; &lt;/rule&gt; &lt;rule name="Imported Rule 2" stopProcessing="true"&gt; &lt;match url="^$" ignoreCase="false" /&gt; &lt;action type="Rewrite" url="index.php?kohana_uri={R:1}" appendQueryString="true" /&gt; &lt;/rule&gt; &lt;rule name="Imported Rule 3" stopProcessing="true"&gt; &lt;match url="^index.php/(.*)" ignoreCase="false" /&gt; &lt;action type="Redirect" redirectType="Found" url="{R:1}" appendQueryString="true" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; </code></pre> <p>But it seems this code is not working as the index.php is still there. The ISS URL Rewrite Module is working since another rule "Enforce canonical hostname" which i added in the web.config is working properly.</p> <p>This is my complete web.config file.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;configuration&gt; &lt;system.webServer&gt; &lt;directoryBrowse enabled="false" /&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;rule name="Enforce canonical hostname" stopProcessing="true"&gt; &lt;match url="(.*)" /&gt; &lt;conditions&gt; &lt;add input="{HTTP_HOST}" negate="true" pattern="^www\.moviega\.com$" /&gt; &lt;/conditions&gt; &lt;action type="Redirect" url="http://www.moviega.com/{R:1}" redirectType="Permanent" /&gt; &lt;/rule&gt; &lt;rule name="Imported Rule 1" stopProcessing="true"&gt; &lt;match url="^(.*)$" ignoreCase="false" /&gt; &lt;conditions&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="index.php?kohana_uri={R:1}" appendQueryString="true" /&gt; &lt;/rule&gt; &lt;rule name="Imported Rule 2" stopProcessing="true"&gt; &lt;match url="^$" ignoreCase="false" /&gt; &lt;action type="Rewrite" url="index.php?kohana_uri={R:1}" appendQueryString="true" /&gt; &lt;/rule&gt; &lt;rule name="Imported Rule 3" stopProcessing="true"&gt; &lt;match url="^index.php/(.*)" ignoreCase="false" /&gt; &lt;action type="Redirect" redirectType="Found" url="{R:1}" appendQueryString="true" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>So where is the problem??. What should be done to remove the index.php from the url?? Please help me sort this out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload