在 .conf 文件而不是 .htaccess 中设置规则时,apache2 中的 mod 重写出现问题

发布于 2024-08-27 07:28:25 字数 452 浏览 5 评论 0原文

由于我的托管提供商的奇怪安全策略,我必须在 /etc/apache2/conf.d/examplesite.conf 中定义重写规则,而不是将它们写入该站点的 www 文件夹中的 .htaccess 中。

我想做的是设置一个 Wordpress Mu 服务器(http://mu.wordpress. org/forums/topic/17349 ),到目前为止,其工作进度为 50%。

主博客可以完美加载,但其他子博客(例如位于 www.example.com/blog2 )却无法加载。

我猜测问题在于,在每个虚拟主机的 .conf 文件中声明而不是使用 .htaccess 文件时,重写规则的行为有所不同。

还有其他人遇到过这个问题吗?你怎样才能解决它?

Because of weird security policies of my hosting provider I have to define my rewrite rules in /etc/apache2/conf.d/examplesite.conf instead of writing them on an .htaccess on the www folder of that site.

What I'm trying to do is setup a Wordpress Mu server (http://mu.wordpress.org/forums/topic/17349 ) and so far its working on a 50%.

The main blog loads perfectly but other sub blogs (located for example at www.example.com/blog2 ) don't.

I'm guessing the problem is that the rewrite rules behave differently when declared at .conf files for each virtual host instead of using .htaccess files.

Has anybody else had this problem? How can you fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖伴 2024-09-03 07:28:25

对我来说,这听起来不像是重写问题,但也许确实如此。当您尝试加载子博客之一时,您没有说明错误是什么。也许发布您的重写规则会有所帮助。另外,您是否能够设置一个场景,在本地主机或其他东西上的 .htaccess 文件中执行它们,并查看是否有差异?

This doesn't sound like a rewrite problem to me but maybe it is. You don't say what the error is when you try to load one of the sub blogs. Perhaps posting up what your rewrite rule is would be helpful. Also would you be able to set up a scenario where you did them in .htaccess files on a localhost or something and seeing if there was a difference?

不爱素颜 2024-09-03 07:28:25

如果漂亮的永久链接有效,则 mod_rewrite 已启用,并且成功将 URL 重写到 WordPress。

如果是这种情况,则说明您的 MU 安装存在问题。

您在 MU 安装期间是否选择了子域路径?如果您没有,但后来又切换了,那就是问题所在 - 您可以全新安装吗?

If pretty permalinks work, then mod_rewrite is enabled, and rewriting URLs to WordPress successfully.

If this is the case, then it's a problem with your MU install.

Did you choose paths over sub-domains during the MU install? If you didn't, but then later switched, that's where the problem is - are you in a position to fresh install?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文