du9843 2015-03-27 16:59
浏览 45
已采纳

Wordpress安装在root和子文件夹+两个域中

God, this little problem drives me crazy and I really hope that you'll help me how to figure it out.

I searched over all previous threads and in the codex of wordpress, didn't find my exact problem. This is it : I've one host with a wordpress installed at the root. I've one domain pointing it. Everything is fine. I've need now a second install of wordpress, that i've installed in a subfolder. I've a second domain, linked to this subdfoler.

Like this :

  • root > domain.net
  • root/subfolder > anotherdomain.net

If I let the "site url" setting and the "wordpress url" setting with "domain.net/subfolder", this is OK, I can access to my second site and all permalinks work.

But if I edit my site url/wordpress url in "anotherdomain.net" it renders the "domain.net" homepage without style...

I'm sure this is a question of HTACCESS but I can't find how to properly write it...

Thanks for your answers !

(sorry for my english, not my mother tongue)

EDIT : Here are .htaccess (at this state, I let them in order to access subfolder via domain.net/subfolder)

root:

# 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>

root/subfolder

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

# END WordPress
  • 写回答

2条回答 默认 最新

  • doumanshan6314 2015-04-16 14:10
    关注

    All the config were good, the problem was with my host provider.

    For the record, the htaccess for the site in the subfolder, when everything is ok :

    # 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
    

    And the site and wordpress urls pointing to the new domain.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统