卡住-一切可能-index.php无法从Codeigniter中的服务器上删除url上的
我坚持这一点 无法从服务器上删除url上的index.php 我尝试在localhost中运行良好 这是我的.htaccess卡住-一切可能-index.php无法从Codeigniter中的服务器上删除url上的,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我坚持这一点 无法从服务器上删除url上的index.php 我尝试在localhost中运行良好 这是我的.htaccess RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 我
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
我正在尽一切可能(htaccess)来解决这个问题
请你给我一些建议或解决办法来解决这个问题
非常感谢你 删除config.php中的索引url
$config['index_page'] = '';
和htaccess如下所示
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
希望它能解决你的问题。如果不让我知道请删除config.php中的索引url
$config['index_page'] = '';
和htaccess如下所示
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
希望它能解决你的问题。如果不让我知道,请在根目录中创建.htaccess文件并添加以下代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
如果$config['uri_protocol']='PATH_INFO'代码>无效,请尝试将其更改为:
$config['uri_protocol'] = 'QUERY_STRING'; OR,
$config['uri_protocol'] = 'REQUEST_URI'; OR,
$config['uri_protocol'] = 'ORIG_PATH_INFO';
3.)在apache
目录中的httpd.conf文件中进行以下编辑
AllowOverride none
到AllowOverride All
和,#LoadModule rewrite_module modules/mod_rewrite.so
到LoadModule rewrite_modules/mod_rewrite.so
1.)在根目录中创建.htaccess文件并添加以下代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
如果$config['uri_protocol']='PATH_INFO'代码>无效,请尝试将其更改为:
$config['uri_protocol'] = 'QUERY_STRING'; OR,
$config['uri_protocol'] = 'REQUEST_URI'; OR,
$config['uri_protocol'] = 'ORIG_PATH_INFO';
3.)在apache
目录中的httpd.conf文件中进行以下编辑
AllowOverride none
到AllowOverride All
和,\LoadModule rewrite\u module modules/mod\u rewrite.so
到LoadModule rewrite\u modules/mod\u rewrite.so
1)创建.htaccess文件
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
2) 编辑config/config.php文件
$config['base_url'] = 'http://localhost/projectname';
$config['index_page'] = ''; // remove index.php
1) 创建.htaccess文件
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
2) 编辑config/config.php文件
$config['base_url'] = 'http://localhost/projectname';
$config['index_page'] = ''; // remove index.php
更改$config['index_page']='index.php'代码>至$config['index_page']=''代码>并尝试使用哪个URL?你预计会发生什么?然后会发生什么呢?CI应用程序的位置是在web服务器的根目录中还是在某个子目录中?url工作:alpha.com/index.php/login。。url无法工作:alpha.com/login。。我想删除服务器中的index.php@OlafDietschedirectory====>/=>root=>var=>www=>alpha@Tpojkachange$config['index\u page']='index.php'代码>至$config['index_page']=''代码>并尝试使用哪个URL?你预计会发生什么?然后会发生什么呢?CI应用程序的位置是在web服务器的根目录中还是在某个子目录中?url工作:alpha.com/index.php/login。。url无法工作:alpha.com/login。。我想删除服务器中的index.php@OlafDietschedirectory====>/=>root=>var=>www=>alpha@Tpojkapart 1和2我尝试了,但无法工作。。第三部分还没有。。因为我在服务器上。。我先试试..但是在本地我试着编辑这个->AllowOverride none to AllowOverride All和AllowOverride All to AllowOverride none都不能正常工作,但是我想先在服务器上试试在.htacess文件中试试:RewriteEngine on RewriteBase/your_application/RewriteCond%{REQUEST_FILENAME}-f RewriteCond%{REQUEST_FILENAME}-d重写秒1美元^(index\.php | js | img | css | captcha | robots\.txt)RewriteRule^(.*)$/ci/index.php/$1[L]
第三个执行程序成功第1部分和第2部分我尝试了,但无法工作。。第三部分还没有。。因为我在服务器上。。我先试试..但是在本地我试着编辑这个->AllowOverride none to AllowOverride All和AllowOverride All to AllowOverride none都不能正常工作,但是我想先在服务器上试试在.htacess文件中试试:RewriteEngine on RewriteBase/your_application/RewriteCond%{REQUEST_FILENAME}-f RewriteCond%{REQUEST_FILENAME}-d重写秒1美元^(index\.php | js | img | css | captcha | robots\.txt)RewriteRule^(.*)$/ci/index.php/$1[L]
第三次执行成功确保已在Apache模块中启用重写模块。确保已在Apache模块中启用重写模块。