Forum Moderators: phranque
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L] I removed "^" and "$" from the RewriteRule leoo24 posted, i don't think they were wrong, but i don't think they made much of a difference either ;)
In other words I'd like to change example.com to www.example.com except when referenced as a secure server of [example.com....]
Can that be done?
How would you change the following to accomplish that?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) [example.com...] [R=301,L]
You may need these:
mod_rewrite [httpd.apache.org]
Regular expressions [etext.lib.virginia.edu]
The mod_rewrite link also has a link to a URL rewriting guide at the end.