[英]WordPress in base.example.com and accessible from example.com give me path issue in Hostgator
I have a WordPress installation at Subdomain . 我在Subdomain中安装了WordPress 。 I wish to have the website display the site at example.com 我希望网站在example.com上显示该网站
The WordPress folder is located at base.example.com and the path is public_html/folder1/base . WordPress文件夹位于base.example.com ,路径为public_html / folder1 / base 。
If I run the site from the subdomain with home and site url pointing to base.example.com everything works fine. 如果我从子域运行该站点,并且其home和站点url指向base.example.com,则一切正常。 If I change the second url to my root example.com copying index.php (changing the path) and .htaccess to public_html/ I get the following issue: 如果我将第二个URL更改为我的根example.com,将index.php复制(更改路径)并将.htaccess更改为public_html / , 则会遇到以下问题:
Are 5 days that I'm trying to solve it so I also wrote to hostgator support because I think I did everything in the right way but they just say they can't support issue wich came from customization....but this is not a customization, is just making work a simple wordpress installation from a subdomain!!! 我想解决问题的时间是5天,所以我也写信给hostgator支持,因为我认为我以正确的方式做了所有事情,但他们只是说他们不支持自定义带来的问题....但这不是定制只是使工作从子域进行简单的wordpress安装!!!
Hope you can help me! 希望你能帮我!
EDIT 编辑
.htaccess (both in public_html/ and in public_html/folder1/base are the same) .htaccess (public_html /和public_html / folder1 / base中的都是相同的)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %.{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
index.php (in root) index.php(在根目录中)
require('./folder1/base/wp-blog-header.php');
index.php (in public_html/folder1/base) index.php(在public_html / folder1 / base中)
require('./wp-blog-header.php');
EDIT 2 编辑2
Updated question 4,5,6 更新问题4,5,6
I've tried to install wordpress in a simple subfolder and all the issue disappear but as I'm stubborn I want to achieve to make wordpress working in a subdomain instead a subfolder... 我试图将Wordpress安装在一个简单的子文件夹中,所有问题都消失了,但是由于我很固执,我想实现让Wordpress在子域而不是子文件夹中工作的目的。
This is normal behavior. 这是正常现象。 You can change this through a 301 redirect in your .htaccess
within the root of the subdomain folder (not the root of your website). 您可以通过.htaccess
域文件夹的根目录(而不是网站的根目录)中的301重定向来更改此设置。 This code excludes /wp-content/* (for uploads access, plugins access, theme file access, etc.), /wp-admin/* (for admin access), and /wp-includes/* (for important WordPress includes access). 此代码不包括/ wp-content / *(用于上载访问,插件访问,主题文件访问等),/ wp-admin / *(用于管理员访问)和/ wp-includes / *(对于重要的WordPress包含访问权限) )。 Try this code and see what happens: 试试下面的代码,看看会发生什么:
RewriteEngine on RewriteCond %{REQUEST_URI} !^/wp-content/ RewriteCond %{REQUEST_URI} !^/wp-admin/ RewriteCond %{REQUEST_URI} !^/wp-includes/ RewriteRule (.*) http://www.example.com/$1 [R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.