randrp Posted July 1, 2010 Share 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! Link to comment Share on other sites More sharing options...
randrp Posted July 1, 2010 Author Share 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> Link to comment Share on other sites More sharing options...
Zhana Posted July 3, 2010 Share Posted July 3, 2010 Great. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.