繁体   English   中英

在本地主机上找不到错误404

[英]Error 404 Not found on localhost

我已经在URL上的locahost上托管了一个脚本: http : //127.0.0.1/rent/

问题是,每当我运行脚本时,它就会给我“在此服务器上找不到所请求的URL /index.php”。 以下是我的.htaccess文件:

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

我用以下组合编辑了该行:此行:RewriteRule ^(。*)$ /index.php?/$1 [L]

组合:

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

但没有任何效果,请您在这里帮助我,谢谢

您是否尝试过仅使用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

这是假设您将.htaccess放在localhost / rent /文件夹中

暂无
暂无

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

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