• I have the following rules in my .htaccess file on a WordPress (single installation):

    # REWRITE FORUMS DOMAIN TO FOLDER
    RewriteCond %{HTTP_HOST} ^forums\.example\.com$
    RewriteRule !^forums/? forums%{REQUEST_URI} [NC,L]
    # REWRITE FORUMS FOLDER TO SUBDOMAIN
    RewriteCond %{THE_REQUEST} \s/forums/([^\s]*) [NC]
    RewriteRule ^ https://forums.example.com/%1 [R=301,L]

    This is so that the forums that exist at https://example.com/forums are accessed at https://forums.example.com/

    However the server just blows up with a 500 server error…

    Any ideas on how to do this? These rules work perfectly when used on non-wordpress sites… The second rewrite rules successfully send /forums to the sub domain but the subdomain doesn’t seem to be able to pass the data into WordPress correctly.’

    Here is the htaccess file in its entirety:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # REWRITE FORUMS DOMAIN TO FOLDER
    RewriteCond %{HTTP_HOST} ^forums\.example\.com$
    RewriteRule !^forums/? forums%{REQUEST_URI} [NC,L]
    
    # REWRITE FORUMS FOLDER TO SUBDOMAIN
    RewriteCond %{THE_REQUEST} \s/forums/([^\s]*) [NC]
    RewriteRule ^ https://forums.example.com/%1 [R=301,L]
    
    # BEGIN WordPress
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
    
    </IfModule>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi :),

    If you are getting 500 Internal server error, then ask your hosting provider for exact logs. So that you can find out which line is causing the error.

    Thread Starter driz

    (@driz)

    @dan

    The 500 is being caused by WordPress… The error is:

    [Wed Mar 25 08:26:58 2015] [error] [client 85.159.133.48] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

    Basically the issue is that WordPress doesn’t know how to handle it. Like I said these rules work with non-WordPress websites, so it’s a problem there.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use subdomain for certain urls’ is closed to new replies.