server-variables in RewriteCond?

This is a discussion on server-variables in RewriteCond? within the Linux Web Servers forums, part of the Web Server and Related Forums category; I've been trying to do this: RewriteCond %{HTTP_HOST} !%{SERVER_NAME} RewriteRule ^(.*)$ http://%{SERVER_NAME}$1 [R=301,L] as a generic ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-12-2007
phantom
 
Posts: n/a
Default server-variables in RewriteCond?

I've been trying to do this:

RewriteCond %{HTTP_HOST} !%{SERVER_NAME}
RewriteRule ^(.*)$ http://%{SERVER_NAME}$1 [R=301,L]

as a generic 301 all host names to the definitive server name, but it
appears that I cannot simply insert a server-variable in the RHS of the
RewriteCond.

Is there any way round this, apart from using the actual server name on the
RHS?


 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:00 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0