.htacess - how to force no "www" in ip address?

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-03-2009, 11:12 PM
New Pligger
 
Join Date: May 2009
Posts: 5
Hi all,

I hope someone can help me with the following question-

I'm trying to configure my .htaccess file so that if someone types in www.mydomain.net, it redirects to mydomain.net (ie, without the "www.")

I can usually do this no problems on other websites, by adding

Code:
RewriteCond %{HTTP_HOST} ^www.mydomain.net$
RewriteRule ^(.*)$ "http\:\/\/mydomain\.net$1" [R=301,L]
But if I add these lines to the Pligg default .htaccess file, I end up getting an error message from my web browser stating: "Redirect Loop: Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

I'm not really an expert on the language used in the .htacess file - has anyone had a similar issue which they were able to solve?

Many thanks for any help!

-vwest
Reply With Quote
  #2 (permalink)  
Old 05-03-2009, 11:20 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
Quote:
Originally Posted by vincentwest View Post
Hi all,

I hope someone can help me with the following question-

I'm trying to configure my .htaccess file so that if someone types in www.mydomain.net, it redirects to mydomain.net (ie, without the "www.")

I can usually do this no problems on other websites, by adding

Code:
RewriteCond %{HTTP_HOST} ^www.mydomain.net$
RewriteRule ^(.*)$ "http\:\/\/mydomain\.net$1" [R=301,L]
But if I add these lines to the Pligg default .htaccess file, I end up getting an error message from my web browser stating: "Redirect Loop: Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

I'm not really an expert on the language used in the .htacess file - has anyone had a similar issue which they were able to solve?

Many thanks for any help!

-vwest
Try this

Code:
RewriteCond %{HTTP_HOST} ^www.mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]
Reply With Quote
  #3 (permalink)  
Old 05-04-2009, 12:25 AM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
Or: http://forums.pligg.com/installation...html#post78728

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #4 (permalink)  
Old 05-04-2009, 01:37 AM
New Pligger
 
Join Date: May 2009
Posts: 5
Quote:
Originally Posted by Yankidank View Post
Thank you both! I used the first one, which seems to be working ok so far.

Thanks again!
Reply With Quote
Reply

Tags
.htaccess, htaccess, ip rename, no www, www

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
FYI - Strange email address in register.php nzbullet Questions and Comments 2 07-26-2011 12:09 AM
Limit votes by IP address fingerprn Questions and Comments 7 12-17-2008 12:47 PM
Ho to add User's Last login IP address in Admin rubber2002 Questions and Comments 5 04-22-2008 07:50 PM
IP Address Database Storage MicroBerto Questions and Comments 5 03-08-2008 11:36 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development