Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
randrp Posted July 1, 2010 Posted July 1, 2010 I used to use the following code on my website to force all traffic to use no www in the URL.RewriteEngine On RewriteCond %{HTTP_HOST} ^www.ncaastrategies.com$ RewriteRule ^(.*)$ http://ncaastrategies.com/$1 [R=301,L] ipBoard calls for me to add the following information to my .htaccess file. <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase /utopia/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /utopia/index.php [L] </IfModule> Using both snippets in my .htaccess file like so does not provide the result I would hope for. Instead of redirecting to the same URL minus the www - it instead redirects to the forum index. <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase /utopia/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /utopia/index.php [L] </IfModule> RewriteEngine On RewriteCond %{HTTP_HOST} ^www.ncaastrategies.com$ RewriteRule ^(.*)$ http://ncaastrategies.com/$1 [R=301,L] Could someone please help me in making it so that the ipBoard rule works in tandem with a no www redirect? Thanks!
randrp Posted July 1, 2010 Author Posted July 1, 2010 Special thanks to Ryan Dwyer of Ubuntu Forums for simplifying this for me.<IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteCond %{HTTP_HOST} ^www.ncaastrategies.com$ RewriteRule ^(.*)$ http://ncaastrategies.com/$1 [R=301,L] RewriteBase /utopia/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /utopia/index.php [L] </IfModule>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.