jaymc Posted March 6, 2010 Share Posted March 6, 2010 I usually rewrite none www. urls using this method rewritecond %{http_host} ^website.co.uk [nc] rewriterule ^(.*)$ http://www.website.co.uk/$1 [r=301,nc] Although that works, I need a way to do it where I do not need to statically set the domain name as the same vhost will be used for multiple deomains, hence I cant statically set the domain name as its dynamic e.g something like this (obviously not correct syntax) rewritecond %{http_host} ^{$DOMAIN} [nc] rewriterule ^(.*)$ http://www.{$DOMAIN}/$1 [r=301,nc] Any ideas how to elimate the need to statically assign url? Link to comment https://forums.phpfreaks.com/topic/194306-rewrite-www/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.