我真的找不到一个方法来使我的.htaccess工作,并从我的localhost网站的 url 删除/index.php/部分: http:// localhost /ci_intro/index.php/home/
来自XAMPP / xamppfiles / htdocs / ci_intro / application / config / routes.php :
$ route ['default_controller'] ='home'; $ route ['404_override'] =''; XAMPP / xamppfiles / htdocs / ci_intro / application / config / config.php 中的:
$ config ['base_url'] ='http:// localhost / ci_intro /'; $ config ['index_page'] =''; $ config ['uri_protocol'] ='AUTO'; XAMPP / xamppfiles / etc / httpd.conf 中的:
LoadModule rewrite_module modules / mod_rewrite.so ... < Directory / Applications / XAMPP / xamppfiles / htdocs> 选项索引FollowSymLinks ExecCGI包括 AllowOverride所有需要所有授予< / Directory>mod_rewrite.so正在工作,我已经用phpinfo XAMPP / xamppfiles / htdocs / ci_intro / .htaccess 中的p>
:
< IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ci_intro / RewriteCond%{REQUEST_URI} ^ system。* RewriteRule ^(。*)$ /index.php?/$1 [ L] RewriteCond%{REQUEST_URI} ^ application。* RewriteRule ^(。*)$ /index.php?/$1 [L] RewriteCond% {REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d RewriteRule ^(。*)$ index.php?/ $ 1 [L] < / IfModule> < IfModule!mod_rewrite.c> ErrorDocument 404 /index.php < / IfModule>任何想法? 请在这里真的需要帮助,谢谢!
解决方案RewriteEngine On RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d RewriteRule ^(。*)$ index.php / $ 1 [L]
在您的htaccessework中写这个选中此链接以启用的mod_rewrite功能安装设置
I really can't find a way to make my .htaccess work and eliminate the /index.php/ part from my localhost site's url: localhost/ci_intro/index.php/home/
From XAMPP/xamppfiles/htdocs/ci_intro/application/config/ routes.php :
$route['default_controller'] = 'home'; $route['404_override'] = '';from XAMPP/xamppfiles/htdocs/ci_intro/application/config/ config.php :
$config['base_url'] = 'localhost/ci_intro/'; $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO';from XAMPP/xamppfiles/etc/ httpd.conf :
LoadModule rewrite_module modules/mod_rewrite.so ... <Directory "/Applications/XAMPP/xamppfiles/htdocs"> Options Indexes FollowSymLinks ExecCGI Includes AllowOverride All Require all granted </Directory>mod_rewrite.so is working, I've checked it with a phpinfo()...
from XAMPP/xamppfiles/htdocs/ci_intro/ .htaccess :
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /ci_intro/ RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule>Any ideas? Please I really need help here, thanks!
解决方案 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]write this in your htaccess check this link to enable mod_rewrite function of apache setting
更多推荐
删除index.php代码符号
发布评论