Forum Moderators: phranque
I have a host that I have wildcard subdomains active, but I need all the subdomains to 301 to the WWW version.
I tried the code below, but all I managed to do was get my server to produce 500 internal server errors.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.example\.com.tld
RewriteRule (.*) http://www.example.com.tld [R=Permanent] I searched the forum, I swear. help
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com.tld
RewriteRule (.*) http://www.example.com.tld/$1 [R=Permanent,L]
RewriteRule [b]^/[/b](.*) http://www.example.com.tld/$1 [R=Permanent,L]
Jim
I have set up the .htaccess file to redirect non-www to www.
However I have also see links coming into my site such as "http/" or http:/"
Do I need to redirect these also? If so, how do I change the code I've posted below?
2nd question.
I have several subdirectories with their own index page. Do I need to put an htaccess in those files also or will the root htaccess cover everything. If I need to can someone show me how to alter the following:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ [example.com...] [R=permanent,L]