Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 拆下'/主页';来自URL的目录_Apache_.htaccess - Fatal编程技术网

Apache 拆下'/主页';来自URL的目录

Apache 拆下'/主页';来自URL的目录,apache,.htaccess,Apache,.htaccess,我得到的人'www.domain.com/home'。我想从名称“/home”中删除。刚刚打开的url应该位于'www.domain.com'左侧 我测试了htaccess,但这不起作用。我看到服务器自动从URL中删除'index.html'。有些规则在我的htaccess中有效,但在URL中替换a名称-不是 有人知道如何删除“/home”?我整个上午都在寻找解决方案,但没有任何效果…通过httpd.conf启用mod_rewrite和.htaccess,然后将此代码放在文档根目录下的.htac

我得到的人
'www.domain.com/home'
。我想从名称“/home”中删除。刚刚打开的url应该位于
'www.domain.com'
左侧

我测试了htaccess,但这不起作用。我看到服务器自动从URL中删除'index.html'。有些规则在我的htaccess中有效,但在URL中替换a名称-不是


有人知道如何删除“/home”?我整个上午都在寻找解决方案,但没有任何效果…

通过
httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放在
文档根目录下的
.htaccess
中:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On

RewriteRule ^home/?$ / [L,R=301,NC]

你能把文档根移到家里吗?是的,我能。。。但我认为这是一个简单的方法。我需要做的代码刷新主页页面。这就是问题所在;)但我会制作一些移动页面…冷却谷歌上的每个链接,比如“在谷歌上搜索什么是httpd.conf…”。。看在上帝的份上…如果你的意思是“复制并粘贴到”.htaccess”-不,这不起作用。你启用了.htaccess吗?尝试将一些随机文本放在文件顶部,看看是否会产生500个错误?