This is a discussion on Rewrite question within the Linux Web Servers forums, part of the Web Server and Related Forums category; I have a silly question if anyone can spare a moment -- I'm downright terrible when it comes to Mod ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have a silly question if anyone can spare a moment -- I'm downright
terrible when it comes to Mod Rewrite and regex. Basically, all I need is an addition for .htaccess to redirect a domain (or more specifically, trim off www or whatever's at the beginning.) For example, if the user put www.domain.com in the browser, the htaccess should redirect to domain.com. I *think* I came close, but it doesn't work, the browser returns with too many redirections error (caught in a loop): RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC,OR] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] Any suggestions? Thanks |
|
|||
|
On 28 May 2005 22:31:31 -0700, jbysmith@yahoo.com <jbysmith@yahoo.com> wrote:
> I *think* I came close, but it doesn't work, the browser returns with > too many redirections error (caught in a loop): > > RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC,OR] > RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] > > Any suggestions? Thanks > [NC,OR] looks wrong - any improvement with just [NC] ? vh Mads Toftum -- Speaking at ApacheCon 2005/EU - http://apachecon.com |