Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 46779

Re: Domain name without www loads with no theme

$
0
0
by Bruno Soldier.  

I agree about the "magic" - using HTTP_HOST in config.php seemed to involve too many assumptions about what was placed in the database when the instance was created.

However, I have it working now, using mod_rewrite.

The code is:

<IfModule rewrite_module>

Options Indexes FollowSymLinks +IncludesNOEXEC
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mydomain\.org$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.org/$1 [L,R=301]

</IfModule>

This checks for mydomain.org lacking "www" and rewrites to

 http://www.mydomain.org

Functionality, CSS, etc. seem normal.

The rewrite occurs "on-the-fly" before server processing begins, so Moodle should only see the "www" version.

Would you forsee any problems with this?  


Viewing all articles
Browse latest Browse all 46779

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>