Reputation:
I use my htaccess to remove index.php from the url. Application is working fine when on my pc. I use XAMPP. but when i uploaded into the server it only shown the homepage, i cannot access other controller without index.php in windows live server
Upvotes: 1
Views: 224
Reputation: 11
I had similar issue. Place this on your .htaccess file on the root directory.This solved the issue for me.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
Upvotes: 1
Reputation: 682
Hta access wont work in Windows live server you have to modified web.config file in root folder of your project and add rewrite code under the part like this . sure it will helps you .
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rule" 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/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<directoryBrowse enabled="true" />
<defaultDocument>
<files>
<clear />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="Default.aspx" />
<add value="index.php" />
<add value="index.html" />
<add value="index.pl" />
<add value="default.html" />
<add value="Default.cshtml" />
</files>
</defaultDocument>
<httpProtocol>
<customHeaders>
<clear />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Upvotes: 2