douzhuican0041 2016-09-28 16:12
浏览 66

Wordpress Multisite通过多个子文件夹安装

I have an existing wordpress install that has been integrated into magneto e-commerce system and I have transitioned the wordpress over to a network install.

Folder structure is the following:

httpdocs\wp <-- Wordpress httpdocs\store <-- Magento Install

I can currently get Wordpress integrated into Magento so that the blog appears under store\blog with both the admin panel and network admin panel working correctly.

However what I can't get to work is accessing the admin or front-end of a new site created in a subfolder of /newsite (example)

the admin link of httpdocs/newsite/wp-admin and httpdocs/newsite both give 404 errors

I was advised to update .htaccess in /wp and wp-config in the same location but I'm totally unable to get the new subfolder site up and running.

I also tried copying the .htaccess and index.php from the /wp folder into /httpdocs however that only got me limited html from the front end, with lots of 404's where wordpress is looking for a physical wp-admin folder in /newsite/

I'm totally stuck at the moment. I've been trying modifications to httpdocs/.htaccess but unable to get it working that way either.

Ideally I need /httpdocs/* to redirect to /store unless a request is made for /newsite in which case /newsite should load.

  • 写回答

1条回答 默认 最新

  • droxlzcgnr639823 2016-09-29 09:24
    关注

    The answer to this is that the httpdocs folder needed directing to the /wp/ subdir for all content|admin|includes requests. Several coffee's and some sleep were the requirements to see the solution this morning!

    ErrorDocument 404 /notfound.htm
    RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
    RewriteRule .* – [F,L]
    
    
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /wp/
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress
    
    评论

报告相同问题?