![](/img/trans.png)
[英]Move WordPress site from example.com/dir to example.com (a stock WordPress theme already exists on example.com)
[英]WordPress in base.example.com and accessible from example.com give me path issue in Hostgator
我在Subdomain中安裝了WordPress 。 我希望網站在example.com上顯示該網站
WordPress文件夾位於base.example.com ,路徑為public_html / folder1 / base 。
如果我從子域運行該站點,並且其home和站點url指向base.example.com,則一切正常。 如果我將第二個URL更改為我的根example.com,將index.php復制(更改路徑)並將.htaccess更改為public_html / , 則會遇到以下問題:
我想解決問題的時間是5天,所以我也寫信給hostgator支持,因為我認為我以正確的方式做了所有事情,但他們只是說他們不支持自定義帶來的問題....但這不是定制只是使工作從子域進行簡單的wordpress安裝!!!
希望你能幫我!
編輯
.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(在根目錄中)
require('./folder1/base/wp-blog-header.php');
index.php(在public_html / folder1 / base中)
require('./wp-blog-header.php');
編輯2
更新問題4,5,6
我試圖將Wordpress安裝在一個簡單的子文件夾中,所有問題都消失了,但是由於我很固執,我想實現讓Wordpress在子域而不是子文件夾中工作的目的。
這是正常現象。 您可以通過.htaccess
域文件夾的根目錄(而不是網站的根目錄)中的301重定向來更改此設置。 此代碼不包括/ wp-content / *(用於上載訪問,插件訪問,主題文件訪問等),/ wp-admin / *(用於管理員訪問)和/ wp-includes / *(對於重要的WordPress包含訪問權限) )。 試試下面的代碼,看看會發生什么:
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.