Forum Moderators: open
Thanks,
Brandon
Thanks,
Brandon
# rewrite to include www.
RewriteCond %{HTTP_HOST}!^www\.yourdomain\.com$
RewriteRule ^(.*)$ [yourdomain.com...] [R=301,L]
Thanks,
Brandon
RewriteEngine on
RewriteCond %{HTTP_HOST}!www\.domain\.com
RewriteRule ^/(.*) [domain.com...] [R=permanent]
Apache will handle adding the final / so you don't have to. It's true that it won't redirect someone who uses a port number on the end. But in general, nobody should be doing that.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
You may or may not need the Options +FollowSymLinks directive. If this option is already configured, you won't need it. Otherwise, mod_rewrite won't work, and you should get an entry in your error logs complaining that FollowSymlinks or SymLinksIfOwnerMatch are not enabled. On some servers, users are not allowed to modify Options, so you may also get an error if you try to enable that Option. The only safe, reliable way to determine this on a live, busy server is to try it in an .htaccess file in a test subdirectory.
Jim
Ex. having
http://purl.org/MYNAMESPACE/* redirecting to
http://myvolatiledomainname/*
and all the links I use in the site have purl.org as base.
I would expect that the crawler would index the site (following 302) but report in results the purl.org URLs and not the temporary redirection URLs.
Is this correct?
(I hope I'm not off-topic.)