如何删除index.php
http://103.4.217.199/~xxxx/index.php/menu
至
http://103.4.217.199/~xxxx/menu
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]不工作
发布于 2015-06-18 13:40:53
从IP地址类型URL运行
*
<ifModule mod_headers.c> Header set Access-Control-Allow-Origin: * </ifModule> RewriteEngine on RewriteBase /~xxxx/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|css|js|images|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L]
发布于 2015-06-18 13:20:38
打开config.php并做以下替换:
$config['index_page'] = "index.php"至
$config['index_page'] = ""在某些情况下,uri_protocol的默认设置不能正常工作。只需替换:
$config['uri_protocol'] ="AUTO"使用
$config['uri_protocol'] = "REQUEST_URI"然后在您的.htaccess文件中使用以下内容:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 发布于 2015-06-18 20:20:11
这是我的.htaccess,在wamp和linux服务器上运行Centos +apache和Ubuntu + Apache。
RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ /path-to-code-igniter-directory/index.php/$1 [L]
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]我还在这里做了一个关于如何做这个的视频
https://www.youtube.com/watch?v=v-4VkR54vLU
(跳到28:50就可以看到.htaccess .I也把它放在视频下面的描述中)
希望这有帮助
https://stackoverflow.com/questions/30916440
复制相似问题