Wordpress 子文件夹安装重定向到 root [英] Wordpress subfolder installation redirecting to root

查看:59
本文介绍了Wordpress 子文件夹安装重定向到 root的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个奇怪的问题.我有我的主站点 (mesopinions.ca),它是一个 wordpress 安装.我也有几个子域,有自己的 wordpress 安装(没有多站点).它与 concours.mesopinions.ca 子文件夹一起工作得很好,但使用这个新文件夹却无法正常工作:partymom.mesopinions.ca

我可以到达,没关系.但是几秒钟后(在某些页面加载后),砰,我得到了主站点 (mesopinions.ca) 而不是那个子域(地址栏中的 url 仍然很好,但屏幕显示的是另一个站点).

尝试清除缓存、多个浏览器/电脑、重新安装 wordpress、将子域更改为另一个子文件夹并测试其他一些 wordpress 主题.Htaccess 文件也被重置为 wordpress 默认值.还在做.

因为有人有过这个吗?我很沮丧,因为我找不到这个问题的答案.

解决方案

确保您的 HT ACCESS 文件包含此代码.

# 开始 WordPress<IfModule mod_rewrite.c>重写引擎开启RewriteBase/site/重写规则 ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d重写规则./site/index.php [L]</IfModule># 结束 WordPress

如果仍然有同样的问题,请检查您的数据库 WP_OPTION 表并根据您的 URL 更改路径.

I have a weird problem going on. I have my main site (mesopinions.ca), it's a wordpress installation. I also have a couple of subdomains, with their own wordpress installation (no multisite). It's working great with concours.mesopinions.ca subfolder, but with this new one it's not working : partymom.mesopinions.ca

I can reach it, it's fine. But after some seconds (after some page loads), bam, I get the main site (mesopinions.ca) instead of that subdomain (the url is still good in the address bar, but the screen is showing the other site).

Tried clearing the cache, multiple browsers/pcs, reinstalling wordpress, changing the subdomain to another subfolder and also testing some other wordpress themes. Htaccess file also been reseted to the wordpress default. Still doing it.

As anyone ever had this ? I'm frustrated since I cannot find the answer to this.

解决方案

Make sure your HT ACCESS file contain this code.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /site/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /site/index.php [L]
</IfModule>

# END WordPress

And if still have same problem then check your database WP_OPTION table and change the path as per your URL.

这篇关于Wordpress 子文件夹安装重定向到 root的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆