• florisvanelteren

    (@florisvanelteren)


    I have set up a wordpress multisite network with the following sites:

    example.org
    example.org/nl
    example.org/en

    I want to redirect example.org to example.org/nl. I’ve tried to do this by adding a 301 redirect to .htaccess at the beginning of the file:

    redirect 301 / https://www.example.org/nl

    This should do the trick I believe, but instead it causes a redirect loop: when I try to access example.org I get example.org/nlnlnlnlnlnl…etc..

    The websites and the network admin environment work fine when the redirect line is removed from .htaccess.

    This solution was implemented by my hosting provider, but they do not know how to fix this mistake.

Viewing 6 replies - 1 through 6 (of 6 total)
  • User78342324

    (@rune-vantage)

    Try this “.htaccess” snippet.

    //301 Redirect Site
    RedirectMatch 301 example.org(.*) example.org/nl/$1

    Thread Starter florisvanelteren

    (@florisvanelteren)

    Hi!

    It doesn’t seem to work right now, I’ve tried your snippet and after that the first line was a comment:

    # 301 Redirect Site
    RedirectMatch 301 example.org(.*) example.org/nl/$1

    It then gives me an 500 internal server error on the website
    I can’t seem to figure out why that is!

    User78342324

    (@rune-vantage)

    Try this. Place this snippet after “RewriteEngine On”.

    RewriteRule ^$ /en [L]
    Thread Starter florisvanelteren

    (@florisvanelteren)

    Okay, I’ve tried the above snippet together with the first one, but it still gave me an internal server error. In fact, even when I remove all the added code from my .htaccess file it gives me an internal server error (on the webpage as well as on the admin page). This means that I’ve reverted back to exactly what I had before asking this question. What could be causing this problem now? How is it possible that it occurs although I haven’t changed anything?

    Thread Starter florisvanelteren

    (@florisvanelteren)

    User78342324

    (@rune-vantage)

    Where are you adding the snippet in your “.htaccess” file?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Redirect in .htaccess for multisite creates loop’ is closed to new replies.