繁体   English   中英

额外的index.php吗? 在网址中添加

[英]Extra index.php ? added in Url

我在主机中使用codeigniter 2.2.0版本和配置的子域(* .domainname.in)。 以下是我的.htaccess文件内容

RewriteEngine on

RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

.htaccess之上的配置适用于Urls以下

domainname.in ----> domainname.in
www.domainname.in --------> domainname.in
www.pune.domainname.in -----> pune.domainname.in

但是当我尝试使用此URL http://pune.domainname.in/auth访问我的身份验证控制器时

它使用index.php重定向到下面的URL

http://pune.domainname.in/index.php?/auth

这是原始域网址

你能说明为什么会这样吗

谢谢

只需将该代码放在.htaccess文件中并尝试

RewriteEngine On
RewriteBase / businesswale.in/
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

试试吧

RewriteEngine On
RewriteBase /your_projct_name/
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM