I'm a total newbie, when it comes to htaccess files and I have a few questions about htaccess files. I would for a start like to accomplish two things:
a) redirect to a page without www. b) get the custom 404 html page working
I have fiddled around with htaccess and read a bunch of tutorials, however I've always gotten a 500 internal server error, when uploading the htaccess file in the root of my provider's server and I would like to know why that is.
From what I understand is that you upload the htaccess file to the root of the server, which would be www/public_html of my domain folder or do I have to change the directory to www/mydomain/public_html?
Anyway so this is what I got so far:
//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com[nc]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc]
//Custom 404 errors
ErrorDocument 404 www/public_html/404.html (the 404.html is in the root folder of the server along with the other html pages)
Thanks in advance for your advice and help!
a) redirect to a page without www. b) get the custom 404 html page working
I have fiddled around with htaccess and read a bunch of tutorials, however I've always gotten a 500 internal server error, when uploading the htaccess file in the root of my provider's server and I would like to know why that is.
From what I understand is that you upload the htaccess file to the root of the server, which would be www/public_html of my domain folder or do I have to change the directory to www/mydomain/public_html?
Anyway so this is what I got so far:
//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com[nc]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc]
//Custom 404 errors
ErrorDocument 404 www/public_html/404.html (the 404.html is in the root folder of the server along with the other html pages)
Thanks in advance for your advice and help!