WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] Fresh Install, subfolder multisite, infinite redirect loop sub-blog login (57 posts)

  1. creativepublishing
    Member
    Posted 1 year ago #

    Hello!

    I just installed a fresh install of WordPress and activated the network/multisite feature.

    I had no problem editing the .htaccess and wp-config.php file as I am reasonably competent in programming. The only deviation from the Network tutorial was that WordPress changed one htaccess rule, adding in my servers path.

    Creation of the first sub-blog went fine, but when trying to access the admin panel for the new blog I go into an infinite redirect loop. The blog itself loads fine, although with no formatting, I assume because I haven't enabled any themes.

    The url is http://www.hostingserversdedicated.com/test/

    Any help would be greatly appreciated.

  2. creativepublishing
    Member
    Posted 1 year ago #

    Nevermind, I got it working.
    Turns out it was a simple issue with the directions that WordPress gave out when enabling the multisite configuration.

    The directions changed the .htaccess code to reflect an absolute path on the server.

    For people who might have this issue in the future, I used this boilerplate .htaccess code:

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

    From this post: POST

  3. sassafrascal
    Member
    Posted 1 year ago #

    Holy cow - this has been torturing me for a week now. You are a godsend. Thank you so much for posting the answer!

  4. cbouchard
    Member
    Posted 1 year ago #

    @creativepublishing - you are a life saver! Like sassafrascal, this has consumed my life. The code worked for me with a subfolder multisite install. Thanks again!

  5. creativepublishing
    Member
    Posted 1 year ago #

    Yes, it is very important to mention that this was for a:

    SUB FOLDER install, not a sub-domain install.

    It seems the common issue with sub-domain installs is an improperly set up wildcard.

    Anyway, I am glad this post was able to help you :)
    Happy holidays!

  6. Christine
    Member
    Posted 1 year ago #

    Thank you SO much! The hours of agony trying to figure this out ...

    Happy holidays to you too!

  7. creativepublishing
    Member
    Posted 1 year ago #

    Glad I could help :)

    And happy holidays to you as well!

  8. dains
    Member
    Posted 1 year ago #

    Thanks so much for catching this and sharing the answer! I just upgraded to 3.5 on my local server and suddenly all my theme dev subsites went boom...

    I have put a good word in with Santa for you. Not that it will mean much coming from me, but it's the best I can do :)

  9. creativepublishing
    Member
    Posted 1 year ago #

    Glad I could help, now get working on your new uber multisite :)

  10. dains
    Member
    Posted 1 year ago #

    For the record, after opening up the .htaccess and comparing it with your boilerplate, all I had to do was remove the absolute path to the local server that WP had added into the .htaccess in two places. So carefully removing those entries will fix things up and also preserve any entries that plugins may have added.

  11. Jonathan Kehayias
    Member
    Posted 1 year ago #

    Any chance you have the IIS 7.5 URL Rewrite web.config rule fixes for this? This is killing me currently in a site migration that is running on IIS.

  12. creativepublishing
    Member
    Posted 1 year ago #

    Sorry :( don't work with IIS.

    If it is the same issue, you should only have to find the spot where the absolute path for the server is and take it out.

    Sorry :(

  13. alex chousmith
    Member
    Posted 1 year ago #

    +1 for this totally fixing it for me as well, SUBFOLDER multisite setup on godaddy hosting

  14. creativepublishing
    Member
    Posted 1 year ago #

    Your welcome Alex, glad I could help :)

    Maybe its time to get like a sticky or something on this post? If this many people have bothered to post AFTER fixing the issue, how many have used it to fix their installation? Might help with some of the repeated questions on this specific forum about this issue......

  15. slingblade01
    Member
    Posted 1 year ago #

    After 4 days....FINALLY!

    Thank you

  16. trickrick
    Member
    Posted 1 year ago #

    I am still stuck with this problem....I am up to the point where the .htaccess file needs to be edited, however... I CANNOT LOCATE IT. I am using Parallels Panel with host gator.

    I am able to make new sites, but when i go to their dashboards, i get a redirect loop.

  17. creativepublishing
    Member
    Posted 1 year ago #

    The htaccess file is in the root directory of your wordpress install. It is a hidden system file ".htaccess" so you might not be able to see in the dashboard. You might need to use an ftp program such as WinSCP.

  18. revkev
    Member
    Posted 1 year ago #

    Hello, after reading numerous threads and trying a number of 'fixes' I stumbled upon this thread and was hopeful...

    Installed the 'boiler plate' code for .htaccess (my .htaccess appears in its entirety below. After adding the 'boiler plate' still had the same issue - unable to access admin page on sub-blogs. This is a new install with no plugins used.

    Your assistance is greatly appreciated!

    # 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

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

  19. creativepublishing
    Member
    Posted 1 year ago #

    Okay,

    An Htaccess file should only have one "RewriteEngine On" This essentially turns of Apache's ModRewrite.

    What you did is add the boilerplate instead of replacing the old code with the new code. You essentially have two htaccess files in once there. Make a backup and then delete the line between #BEGIN WordPress and #END WordPress - then let me know how it goes for you.

  20. revkev
    Member
    Posted 1 year ago #

    Ah thank you so much! Glad I 'gave up' when I did and pushed it aside for awhile. When I removed the 'dupe' code it indeed did work!

    Thank you, I should have seen, or thought of that but admittedly I am a 'nube' in .htaccess! Thank you for your assistance and input for that did indeed resolve the issue!

    Now if someone can direct me how to change this post to resolved, it would be much appreciated!

    Thank you,

    RevKev

  21. creativepublishing
    Member
    Posted 1 year ago #

    Your welcome :) No idea, I am a WordPress "noob" lol.

  22. slodds
    Member
    Posted 1 year ago #

    This is amazing. Spent multiple days looking for this :) I can't stress how awesome you are for posting this!!!!!!!!

  23. p@ulcline.co.uk
    Member
    Posted 1 year ago #

    This is why I love WordPress!

    @creativepublishing thank you so much,

  24. iain.norman
    Member
    Posted 1 year ago #

    perfect - worked for me - after I removed the other set of rewrite rules I had above the boilerplate code!

  25. moberdier
    Member
    Posted 1 year ago #

    Thank You!
    It took me 2 whole days to find this solution.

    Shouldn't they fix this in the in network install instructions?

  26. animationpodcast
    Member
    Posted 1 year ago #

    Thank you SO much creativepublishing!!! I had already spent hours trying to get this to work and I think you just saved me days more of heartache.

    I replaced the code in the htaccess and it just worked like that!

  27. creativepublishing
    Member
    Posted 1 year ago #

    To everyone:

    I am so happy I was able to help you guys. Best of luck in your ventures :)

  28. ThePhantom79
    Member
    Posted 1 year ago #

    Hi,I've the same problem as creativepublishing in his first posts. Dashboard from the first (subfolder) site noch reachable (looperror), site itself is reachable, but without any formating.

    I tried for weeks to edit anything - with no success. I am not familiar with .htaccess, but I changed it into:

    RewriteEngine On
    RewriteBase /wordpress
    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]

    My blogsite (before I installes multisite was in /wordpress. I tried already to change the line in the .htacess into "/", but afterwards nothing worked anymore. What is wrong with my configuration. Help is REALLY REALLY appreciated. (The first blog - created without multisite works still fine ...)

  29. creativepublishing
    Member
    Posted 1 year ago #

    It sounds to me like the issue has to do with your initial install into the /wordpress folder. This probably won't work, but try changing the second line to:
    RewriteBase /wordpress/
    OR this:
    RewriteBase /

    All I did was add a slash after the folder name. The second one might work if the htaccess file in in "/wordpress". You should only need to rewrite base to say "/wordpress/" IF the htaccess is at "/" and the wordpress install is at "/wordpress/". If BOTH the htaccess file and install are at "/wordpress/", I don't believe you would need it.

    A few questions.
    What folder is the htaccess file in? Is it in the root folder "/" or is it in the wordpress folder "/wordpress" ?

    Have you tried the boiler plate code I listed above EXACTLY as it is? Without changing the rewrite base?

    Good luck.

  30. euwingtham
    Member
    Posted 1 year ago #

    Hello,

    I've got the same problem, and I've tried using the boiler plate code that's shown in the second post, EXACTLY, but it failed. Here's my situation...

    I have my WordPress instance setup for Multisite on aaa.com. aaa.com works perfectly fine but when I create another WordPress site on aaa.com/bbb, that's where the problem is. aaa.com/bbb works partially, with the content, but no proper theme. I tried aaa.com/wp-admin, and that's where the redirect loop issue came up.

    This is what I have BEFORE trying the boiler plate code in the second post. What should I edit?

    ---

    RewriteEngine On
    RewriteBase /
    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]
    RewriteCond %{HTTP_HOST} ^aaa\-my\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.aaa\-my\.com$
    RewriteRule ^/?$ "http\:\/\/aaa\.my" [R=301,L]

    Thanks for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic