Drupal:如何重写所有网址以使安装目录不包含在链接中
我在我的网站上安装了 drupal,例如 example.co.uk/portfolio
。
所有链接均显示为 example.co.uk/portfolio/project-1
。
我希望它是 example.co.uk/project-1
我如何使用重写规则或其他规则,以便只要有一个链接显示 /portfolio
目录,它根本不会在 href 中显示它?我希望能够隐藏该网站安装在一个目录中,并希望它显示根 url www.example.co.uk/
中的所有内容
到目前为止, 我搞乱了 RewriteBase /
并通过以下方式将投资组合映射到主根:
RewriteRule ^/?$ /portfolio
I installed drupal on my site at say, example.co.uk/portfolio
.
All the links are showing as example.co.uk/portfolio/project-1
.
I want it to be example.co.uk/project-1
How can I use rewrite rules or whatever so that wherever there is a link that has the /portfolio
directory showing, that it will not show it in the href at all? I want to be able to hide that the site is installed in a directory and want it to show everything from the root url www.example.co.uk/
So far,
I've messed around with RewriteBase /
and also mapping the portfolio to the main root via:
RewriteRule ^/?$ /portfolio
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在根目录的 .htaccess 文件中尝试此 mod_rewrite 规则:
Try this mod_rewrite rule in the .htaccess file in your root directory: