2016-07-16 141 views
0

找不到我的URL托管的脚本上的locahost :http://127.0.0.1/rent/错误404在本地主机上

问题是,每当我运行它给我的剧本“所请求的URL的index.php没有这个发现服务器。” 下面是我的.htaccess文件:

RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt|assets|install) RewriteRule ^(.*)$ /index.php?/$1 [L]

我已经编辑与以下组合行: 这条线:(。*)重写规则^ $ /index.php?/$1 [L]

组合:

/index.php 
subdomain/index.php? 
/subdomain/index.php? 
subdomain/index.php 
/subdomain/index.php 

,但没有奏效,请你,请帮我在这里,感谢

回答

0

您是否尝试过使用RewriteRule ^(.*)$ index.php?/$1 [L]

由于您的网址指向一个子文件夹,当您试图访问http://127.0.0.1/rent,.htaccess文件里面有将使用本地参考重新指向http://127.0.0.1/index.php而非http://127.0.0.1/rent/index.php

这是假设你正在放置localhost /租赁/文件夹中的.htaccess

+0

是的我试过了,它给我500内部服务器错误。 和.htaccess被放置在localhost/rent /文件夹中 –

+0

我刚刚在我身边试过了,它工作正常。你可以提供更多关于你的文件结构的信息吗?你试图访问什么网址?它只是http://127.0.0.1/rent/? – ScarecrowAU

+0

这个脚本使用CodeIgniter /rent/main/application/config/config.php 这里我把目录路径 '*/ $ config ['base_url'] ='http://127.0.01/rent/' ; /* | -------------------------------------------- ------------------------------ |索引文件 | ---------------------------------------------- ---------------------------- | |通常这将是您的index.php文件,除非您已将其重命名为 |别的东西。如果您正在使用mod_rewrite删除设置的页面,请输入以下命令: |变量,以便它是空白的。 | */ $ config ['index_page'] =''; ' –