Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) [example.com$1...] [R=permanent]
should do the trick.
Cheers
John
If you have any data from your server error log, pleas include it.
Jim
The simple redirect for domain.com to www.domain.com works perfectly.
The problem on my server is that it appends the directory structure on to the end of the domain so domain.com/page.htm becomes www.domain.com/directorystructure/page.htm
This would not be a problem if the document was in the root, I assume. However I have around a dozen active sites on the server and each sits in a directory just off root.
I would imagine that stripping the (known) directory/ from the $1 bit would work as all files are in the same directory.
I have posted this same query in another post (before checking this) so sorry for the duplication.