有关 htaccess 和两个 Wordpress 实例的帮助
我有一个旧的遗留应用程序,用 php 编写。它将被两个 WordPress 实例取代,一个是网站本身,另一个是博客(我必须将它们作为两个实例分开使用)。因此,我将为旧版本创建一个目录,为网站创建一个目录,为博客创建一个目录。
这是我的情况现在:
假设我的应用程序网址是http://www.mywebsiteurltest.com/
,我的目录结构如下:
..htdocs/old_site/
files.php
files.css
blog/
wordpress files
我不擅长 htaccess。因此,由于 http://www.mywebsiteurltest.com/
指向 htdocs/old_site/
,因此编写 http://www.mywebsiteurltest.com/blog /
转到 htdocs/old_site/blog/
。所以我的解决方案是创建一个名为 blog 的目录而不是 .htaccess 解决方案来重定向。
我想要更专业的解决方案。我希望我的目录结构为:
..htdocs/
old_site/
site/
blog/
因此,http://www.mywebsiteurltest.com/
将转到 htdocs/site/
和 http:// /www.mywebsiteurltest.com/blog/
到 htdocs/blog/
。我想知道如何在 htdocs/
上创建 .htaccess
来完成此任务。最后我需要有 3 个 .htaccess:
htdocs/.htaccess
具有此配置(知道它将去哪个目录),由我在您的帮助下手动制作 再次htdocs/site/.htaccess
,但使用站点 WordPress 实例配置,由 WordPress 自动创建 htdocs/blog/.htaccess
,但带有博客 WordPress 实例配置,由 WordPress 自动制作
I have an old legacy application, written in php. It's going to be replaced by two Wordpress instances, one being the website itself and the other being a blog (I have to use them separated as two instances). So I'm going to have a dir for this old version, a dir for the site and a dir for the blog.
This is my situation now:
Suppose my app url is http://www.mywebsiteurltest.com/
and my dir structure is as follows:
..htdocs/old_site/
files.php
files.css
blog/
wordpress files
I'm terrible at htaccess. So, since http://www.mywebsiteurltest.com/
is pointing to htdocs/old_site/
, writing http://www.mywebsiteurltest.com/blog/
goes to htdocs/old_site/blog/
. So my solution was to create a dir named blog instead of a .htaccess solution to redirect.
I want a more professional solution. I would like my dir structure to be:
..htdocs/
old_site/
site/
blog/
So, http://www.mywebsiteurltest.com/
would go to htdocs/site/
, and http://www.mywebsiteurltest.com/blog/
to htdocs/blog/
. I would like to know how to create an .htaccess
on htdocs/
to accomplish this. In the end I need to have 3 .htaccess:
htdocs/.htaccess
with this configuration (knowing to which dir it's going to go), manually made by me with your helphtdocs/site/.htaccess
again, but with site wordpress instance configuration, made automatically by wordpresshtdocs/blog/.htaccess
, but with blog wordpress instance configuration, made automatically by wordpress
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以你想要这个,对吧?
如果是这样,你可以尝试这个...
/htdocs/.htaccess:/htdocs/site/.htaccess(WordPress
应该做什么+一点额外的):
>/htdocs/blog/.htaccess(WordPress 应该做什么):
So you want this, right?
If so, you can try this...
/htdocs/.htaccess:
/htdocs/site/.htaccess (What WordPress should do + a little extra):
/htdocs/blog/.htaccess (What WordPress should do):