在wamp不工作的情况下删除codeigniter中的index.php
在使用Wamp服务器从Codeigniter 3的url中删除index.php时,我遇到了问题。我正在修改config.php文件(project_folder/application/config/config.php) 并创建与已编写代码相同级别的应用程序文件夹的.htaccess文件在wamp不工作的情况下删除codeigniter中的index.php,php,.htaccess,codeigniter,url,Php,.htaccess,Codeigniter,Url,在使用Wamp服务器从Codeigniter 3的url中删除index.php时,我遇到了问题。我正在修改config.php文件(project_folder/application/config/config.php) 并创建与已编写代码相同级别的应用程序文件夹的.htaccess文件 <IfModule mod_rewrite.c> # Turn on URL rewriting RewriteEngine On # If your website begins from
<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On
# If your website begins from a folder e.g localhost/my_project then
# you have to change it to: RewriteBase /my_project/
# If your site begins from the root e.g. example.local/ then
# let it as it is
RewriteBase /
# Protect application and system files from being viewed when the index.php is missing
RewriteCond $1 ^(application|system|private|logs)
# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
# Allow these directories and files to be displayed directly:
RewriteCond $1 ^(index\.php|robots\.txt|opensearch\.xml|favicon\.ico|assets|forums)
# No rewriting
RewriteRule ^(.*)$ - [PT,L]
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
</IfModule>
谢谢 在.htaccess文件上尝试此代码
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
在config.php
页面上设置$config['base\u url']=”http://localhost/project/“
和$config['index\u page']=”
和$config['uri_protocol']='AUTO'代码>尝试以下方法:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /folder_name_of_project/
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
RewriteCond $1 !^(index\.php|images|stylesheets|javascript)
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
重新启动发动机
重写项目的基本/文件夹名称/
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php?/$1[L]
重写cond%{REQUEST_URI}^应用程序*
重写规则^(.*)$/index.php?/$1[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
1美元^(索引\.php |图像|样式表| javascript)
重写规则^(.*)$index.php?/$1[L]
ErrorDocument 404/index.php
阅读本教程,通过更改虚拟主机文件httpd-vhosts.conf(C:\wamp\bin\apache\apache2.4.9\conf\extra),将“订单允许、拒绝”替换为“允许所有人”即可解决上述问题!单击Wampserver并选择apache->httpd.conf并从LoadModule rewrite\u module modules/mod_rewrite.so中删除。最后重新启动Wamp服务器
abc.local/controllername
Not found
The requested URL /controllername/ was not found on this server.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /folder_name_of_project/
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
RewriteCond $1 !^(index\.php|images|stylesheets|javascript)
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>