Forum Moderators: phranque
Is there something that I'm putting in incorrectly to do a 301 redirect from non www to www? For some reason I put this in and nothing occurs when I pop the .htaccess file on my server. It's running Apache.
Also, I have more sites that utilize subdomains. What do I need to do in the .htaccess file for sub domains to resolve the non www/www thing other than add sub\.domain\.com differently than a regular main domain?
[edited by: jatar_k at 12:24 am (utc) on Nov. 21, 2006]
[edit reason] changed to example.com [/edit]
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
#
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Get this working first, and then we can discuss subdomains with working code as a basis.
Jim
I've done that and its worked fine with my personal websites, but I'm trying to resolve the issues here at work. We have a few domains and different machines. The one I'm looking at resolving is <snip>. It is running Apache and I have FTP access to the root public_html folder that I'm dropping it into. When I drop it in nothing occurs or changes. Is there some other configuration preventing the .htaccess file from actually doing what is stated in the file? Thanks!
Jeff
[edited by: jdMorgan at 6:17 pm (utc) on Nov. 21, 2006]
[edit reason] No URLs, please. See TOS. [/edit]
Also, checking your server error log will sometimes be quite useful in these cases.
Jim