我创建了一个CodeIgniter应用程序,现在我试图用index.php将urls重定向到没有它的url。在CodeIgniter中重定向index.php
我目前的.htaccess是:
RewriteEngine On
RewriteBase/
# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]
# Enforce www
# If you have subdomains, you can add them to
# the list using the "|" (OR) regex operator
RewriteCond %{HTTP_HOST} !^(www|subdomain) [NC]
RewriteRule ^(.*)$ http://www.plugb.com/$1 [L,R=301]
# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
唯一的问题是,在同一个页面被访问使用和不使用的index.php。
例如:
http://www.plugb.com/index.php/games/adventure-rpg
和
http://www.plugb.com/games/adventure-rpg
有没有办法来重定向的index.php网址吗?
谢谢, 加布里埃尔。
我没有得到它。 你想从URL中删除index.php吗? – ronaldosantana 2010-05-18 22:50:17
@Ronaldo Junior是的。 – 2010-05-18 22:53:56