.htaccess用于重定向到本地主机项目根目录 [英] .htaccess for redirecting to localhost project root
本文介绍了.htaccess用于重定向到本地主机项目根目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在XAMPP本地主机目录中名为myproject的文件夹中有我的PHP本地主机项目.在这个项目中,我需要使用一些超链接,例如:
I have my PHP localhost project in folder named myproject in XAMPP localhost directory. Inside this project I need to use some hyperlinks, for example:
<a href="/">Home</a>
如果我在:
在生产服务器上,这使我进入项目的根目录(主目录),但在localhost上,我得到了:
On production server this get me to the root of project (home), but on localhost I get:
代替
我该怎么做?我想它将与.htaccess文件.谢谢你的建议
How can I do this? I guess it will be something with .htaccess file. Thank you for advice
推荐答案
在httpd.conf
xampp
中搜索并替换为myproject
并重新启动Web服务器:
Search in your httpd.conf
xampp
and replace by myproject
and restart your web server :
DocumentRoot "C:/.../xampp/.."
和<Directory "C:/..../xampp/../"> ...
这篇关于.htaccess用于重定向到本地主机项目根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文