简体   繁体   English

htaccess mod_rewrite目录出现问题

[英]Htaccess mod_rewrite directory trouble

Im having trouble with my clean urls. 我在清理干净的网址时遇到了麻烦。

It works just fine on index.php, but on any other link it adds a folder to the root. 它在index.php上可以正常工作,但是在其他任何链接上,它都会向根目录添加一个文件夹。 For example if im on localhost/test/link/ it gets the css from link/css/main.css. 例如,如果im在localhost / test / link /上,它将从link / css / main.css获取CSS。

I guess i have to set a root directory folder, but since im developing locally it would be a pain to constantly change it between localhost and .com domains. 我想我必须设置一个根目录文件夹,但是由于我是在本地开发的,因此要在localhost和.com域之间不断进行更改会很痛苦。 Is there any solution to this? 有什么解决办法吗?

在所有页面的开头使用此HTML标记:(您的网站根地址)

<base href="http://localhost/">

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

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