Forum Moderators: phranque
when I use this redirect:
RewriteEngine On
rewritecond %{http_host} ^yoursite.com
rewriteRule ^(.*) [yoursite.com...] [R=301,L]
it also redirects my subdomain:
www.directory.yoursite.com
what is the right rewrite for this
thanks again - appreciate your help
[edited by: jdMorgan at 5:26 pm (utc) on Aug. 1, 2005]
[edit reason] No personal URLs, please. See TOS. [/edit]
Welcome to WebmasterWorld!
This makes no sense, unless the code you posted is not *exactly* what you put on your site. The code you posted only redirects domains that start with "yoursite<any_single_character>com".
Although probably unrelated to your current problem, I'd like to give you a friendly reminder that *every single character* in the code must be correct, or you may have problems. You may not freely mix case in the code without eventually having a problem.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite\.com
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
The only other possibilities I can think of is that your server is misconfigured, or that you are using some kind of "domain pointing redirection" service instead of a proper DNS setup.
Jim
The "\" is used to "escape" the period, telling the regular-expressions parser to treat it as a literal period, rather than as a regular-expressions token meaning "any single character."
See the regular-expressions tutorial cited in our forum charter [webmasterworld.com] for more information.
Jim