【发布时间】:2016-08-07 11:44:44
【问题描述】:
我找到了类似的主题,但没有适合我的答案。
我的 htaccess 实际上是:
RewriteEngine on
# remove www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [NE,R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?publigraphix\.com$
RewriteRule !^Jomla_344french/ /Jomla_344french%{REQUEST_URI} [L]/Jomla_344french%{REQUEST_URI} [L]
有了这个,我可以在我的主页的 url 中隐藏子文件夹,但打开我网站的任何页面都会再次出现。
如何在所有页面的 url 中隐藏子文件夹?
感谢您的帮助,这是我的第一篇文章。 问候,
苏珊
感谢您的帮助。现在我的 htaccess 是这样的: 重写引擎开启 RewriteCond %{HTTP_HOST} ^(www.)?publigraphix.com$ RewriteCond %{THE_REQUEST} /Jomla_344french/(.*)\sHTTP [NC] 重写规则 ^ /%1 [NE,L,R] RewriteCond %{HTTP_HOST} ^(www.)?publigraphix.com$ RewriteRule !^Jomla_344french /Jomla_344french%{REQUEST_URI} [NC,L]
对于主页,这可以正常工作,但在子页面中,url 显示 /index.php/ 并出现 404 错误(例如 url 显示:publigraphix.com/index.php/tampons 而不是 publigraphix.com/tampons ...) 你有想法吗?
【问题讨论】:
-
你要去哪个网址?
-
@starkeen www.publigraphix.com 应该打开publigraphix.com/Jomla_344french/index.php
-
我想在该网站的所有页面中隐藏子文件夹 /Jomla_344french 但实际上它只隐藏在主页上
标签: .htaccess hide subdirectory