Tag: .htaccess
.htaccess to redirect root to folder
by z3n on Aug.04, 2010, under Coding, Tips & Hints
Problem:
How to do a 302/permanent SEO compliant redirect from a root folder to somewhere else?
Solution:
RedirectMatch permanent ^/$ http://mydomain.com/php/index.php
Source:
.htaccess to redirect non www to www
by z3n on May.12, 2010, under Tips & Hints
Since i keep forgetting this i’m posting here:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This kind of redirect helps spiders knowing where you site really is, usually if you don’t have those and your non www domain is the same of your www you may get penalized for having a duplicate site. With this 301 redirect this will not happen.
.htaccess 401 note
by z3n on Aug.20, 2009, under Notes
401 redirects must be within the same domain without the full url:
ErrorDocument 401 /error_page.ext <– right
ErrorDocument 401 http://www.example.com/error_page.ext <– wrong, EVEN if your domain is the same that it’s being redirect to.
apache (13) permission deined error
by admin on Oct.13, 2008, under Linux Happyness
Error:
[XXX] [crit] [client XXX] (13)Permission denied: /path/to/user/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
Solution:
chmod 777 /home/userfolder