WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 6 months ago

#31664 new defect (bug)

Multisite network setup for .htaccess

Reported by: wph4 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: Networks and Sites Keywords:
Focuses: multisite Cc:
PR Number:

Description (last modified by SergeyBiryukov)

Hi there,

Sorry if this is not the correct place to post it. But I donot know where then.....

I have 2 multisite installations that were not working.
Dashboard for the Primary site was working. Trying to go to the dashboard for the other sites gave an error code or a loop message. And the other sites where not shown under "My sites" (hover function). I was able to have a look at the child site but it had no theme it was just a "sitemap" list.

What did I wrong? I thougt....

Here what I did:

================ 1st installation (localhost using XAMPP)

  • install wp 4.1.1
  • change config.php to multisite
  • Copy andPaste "Network setup" from Dashboard. Here is the "problem", the .htaccess here shows:
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) D:/Programs/xampp/htdocs/H4Net/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ D:/Programs/xampp/htdocs/H4Net/$2 [L]

After a long researching, I have found an advice from a long time ago and applied. The advise where to change these 2 lines to:

RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) /H4Net/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ /H4Net/$2 [L]

After this change it works.

================ 2nd installation web based hosting

  • install wp 4.1.1
  • change config.php to multisite
  • Copy andPaste "Network setup" from Dashboard. Here is "again" the "problem", the .htaccess here shows:
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) sites/MYURL/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ sites/MYURL/$2 [L]

The solution I found is to change it to:

RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]

================================================

My request is:

Althought I have seen it was already asked some time ago, Network setup still doesnot come up with the correct .htaccess information.
When installing I do follow instructions given. This was the issue.....

I am not a technical person, far from that. I am good in copy and paste :-)
I have seen / read a lot of people are the same as I am, or have the same issue as I had.
So if you could please change it in the next update it would help a lot!

BTW Thanks a lot for making wordpress available!!!!!

Cheers,
Helena
PS: sure I can give screenshots of more info if needed.

Change History (5)

#1 @SergeyBiryukov
5 years ago

  • Description modified (diff)

This ticket was mentioned in Slack in #core by mbootsman. View the logs.


4 years ago

#3 in reply to: ↑ 2 @mbootsman
4 years ago

Replying to slackbot:

This ticket was mentioned in Slack in #core by mbootsman. View the logs.

Using 4.3.1
Created network (directory based)
Used presented code in .htaccess from /wp-admin/network.php line 514 and further

This resulted in redirection loops

Fixed it by using this .htaccess code:

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [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).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

</IfModule>

# END WordPress

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


3 years ago

#5 @lukecavanagh
3 years ago

Having a similar redirect loop issue with subdomain based multisite.

https://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ wp/$1 [L]
RewriteRule . index.php [L]
Note: See TracTickets for help on using tickets.