简体   繁体   English

base.example.com中的WordPress可从example.com访问,这给我Hostgator中的路径问题

[英]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 /则会遇到以下问题:

  1. .htacces is not writable from wordpress .htacces不可从wordpress写入
  2. tons of redirect issue 大量重定向问题
  3. admin bar disappear (solved here Admin bar doesn't appear on the front-end of a WordPress website ) 管理栏消失(在此处解决, 管理栏未显示在WordPress网站的前端
  4. if I open the customizer I get errors (TEMPLATE ISSUE... with default wp themes everything works) 如果我打开定制器,则会收到错误消息(TEMPLATE ISSUE ...,使用默认的wp主题,一切正常)
  5. Using USERPRO Plugin to manage my user after login I'm redirect to the default wordpress login page (that means there is something missed up in url redirect) EDIT: This is the path on the login page that appear after userpro login: http://base.exaple.com/wp-login.php?redirect_to=http%3A%2F%2Fbase.example.com%2Fwp-admin%2F&reauth=1 ... I'm still waiting for an answer from the author 登录后使用USERPRO插件管理我的用户,我将重定向到默认的wordpress登录页面(这意味着url重定向中遗漏了一些内容)编辑:这是userpro登录后出现在登录页面上的路径: http:/ /base.exaple.com/wp-login.php?redirect_to=http%3A%2F%2Fbase.example.com%2Fwp-admin%2F&reauth=1 ...我仍在等待作者的答复
  6. sometimes when I press logout it just reload the admin page. 有时,当我按登出按钮时,只需重新加载管理页面即可。
  7. when I visit base.example.com I'm not redirect to example.com... is this right? 当我访问base.example.com时,我没有重定向到example.com。 it shouldn't redirect me instead? 它不应该重定向我吗?

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

  1. I just get some 404 errors... 我刚收到404错误...

Updated question 4,5,6 更新问题4,5,6

  1. Your suggestion doesn't work. 您的建议无效。 301 redirect force wordpress to find his files in public_html instead the installation folder and obviously it can't find anything giving me an error. 301重定向迫使wordpress在public_html而不是安装文件夹中找到他的文件,显然找不到任何错误。 I've also changed the url form example.com to base.example.com but nothing! 我也将网址格式example.com更改为base.example.com,但没有任何更改!

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在子域而不是子文件夹中工作的目的。

  1. .htaccess being writable is not unusual, being that the site is in a different directory. 可写的.htaccess并不罕见,因为该网站位于其他目录中。
  2. Tons of redirect issues isn't a question, I would need an error to help you solve that problem. 大量的重定向问题不是问题,我需要一个错误来帮助您解决该问题。
  3. Solved by my answer at Admin bar doesn't appear on the front-end of a WordPress website . 通过我在管理栏上的答案解决的问题并未出现在WordPress网站的前端
  4. This isn't a question, I would need an error to help you solve that problem. 这不是问题,我需要一个错误来帮助您解决该问题。
  5. You should contact the UserPro support team via their CodeCanyon account for support with their product. 您应该通过其CodeCanyon帐户UserPro支持团队联系,以获取有关其产品的支持。
  6. What error occurs when you are unable to logout? 无法注销时会发生什么错误? I would need an error to help you solve that problem. 我需要一个错误来帮助您解决该问题。
  7. 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.

相关问题 将 WordPress 站点从 example.com/dir 移动到 example.com(example.com 上已经存在一个股票 WordPress 主题) - Move WordPress site from example.com/dir to example.com (a stock WordPress theme already exists on example.com) 将Wordpress URL从example.com/wordpress更改为example.com/blog - Change Wordpress URL from example.com/wordpress to example.com/blog WordPress从example.com/login重定向到example.com/wp-login.php-如何进行更改? - WordPress redirecting from example.com/login to example.com/wp-login.php - how to change it? 目前,wordpress是供example.com使用的,但我想使用nginx从example.com/blog提供该服务 - Currently, wordpress is served one example.com, but I want to serve it from example.com/blog with nginx 如何在wordpress中将example.com更改为www.example.com - how to change example.com to www.example.com in wordpress WordPress mod_rewrite规则。 停止从example.com重定向到www.example.com - Wordpress mod_rewrite rule. Stop redirecting from example.com to www.example.com example.com/wp-login.php将我重定向到example.com/example.com/wp-admin - example.com/wp-login.php redirects me to example.com/example.com/wp-admin 已安装和卸载的LearnPress插件,但仍将我从example.com/courses重定向到example.com/lp-courses - Installed and uninstalled LearnPress plugin, but it still redirects me from example.com/courses to example.com/lp-courses WordPress的.htaccess RewriteRule:将example.com/yyyy/iframe/映射到example.com/yyyy?iframe=1 - .htaccess RewriteRule for WordPress: map example.com/yyyy/iframe/ to example.com/yyyy?iframe=1 WordPress的.htaccess文件example.com/blog重定向到example.com - .htaccess file for wordpress example.com/blog redirecting to example.com
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM