We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45739
    • 64 Posts
    After editing my .htaccess for Friendly URLs to properly work, my forum.mydomain.com url persists to redirect to mydomain.com/forum. This causes the forum properly not to work due to cookie issues (users can not log in)

    How can I fix this?

    Here is my ht access file:

    # Friendly URLs Part
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    # Force all pages to go to www.domain.com for SEO
    RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
    RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
    # Friendly URLs
    RewriteCond %{HTTP_HOST} ^www\.mydomain\.com
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


    Thanks

      • 46886
      • 1,154 Posts
      Is your forum created using the Discuss extra? It looks like your problem is related to the rewrite rules for Discuss. I had a very similar problem where you can see the forum but can't go into any threads, login, or really anything.

      Pls have a look at this thread which provides a solution for the rewrite rules. Jus copy paste and you should be good to go...

      https://forums.modx.com/thread/89865/getting-started-htaccess-w-code#dis-post-494179
        • 45739
        • 64 Posts
        Quote from: nuan88 at Aug 11, 2014, 04:37 AM
        Is your forum created using the Discuss extra? It looks like your problem is related to the rewrite rules for Discuss. I had a very similar problem where you can see the forum but can't go into any threads, login, or really anything.

        Pls have a look at this thread which provides a solution for the rewrite rules. Jus copy paste and you should be good to go...

        https://forums.modx.com/thread/89865/getting-started-htaccess-w-code#dis-post-494179

        I have pasted the following code and it still did not seem to fix my issue.

        However, my forum is created with MyBB, not Discuss

        <ifmodule mod_deflate.c="">
        AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
        </ifmodule>
         
        <ifmodule mod_expires.c="">
            ExpiresActive On
            ExpiresDefault "access plus 10 days"
            ExpiresByType text/css "access plus 1 week"
            ExpiresByType text/plain "access plus 1 month"
            ExpiresByType image/gif "access plus 1 month"
            ExpiresByType image/png "access plus 1 month"
            ExpiresByType image/jpeg "access plus 1 month"
            ExpiresByType application/x-javascript "access plus 1 month"
            ExpiresByType application/javascript "access plus 1 week"
            ExpiresByType application/x-icon "access plus 1 year"
        </ifmodule>
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You are rewriting everything that does not begin with www.mydomain.com, including forum.mydomain.com, to be www.mydomain.com.
          # Force all pages to go to www.domain.com for SEO
          RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
          RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org