Category Archives: .htaccess
Quick Tip: Directory index forbidden by Options directive
Getting Directory index forbidden by Options directive when trying to list files using the .htaccess? Check to make sure that you DON’T see this in your httpd.conf or welcome.conf file. Options -Indexes The httpd.conf file will be at /usr/local/apachel/conf/httpd.conf on a server with cPanel and at /etc/httpd/conf/httpd.conf on a base CentOS install. The [...]
Deny and allow IP addresses using the .htaccess
You are able to deny or allow all or selected IP addresses or ranges using the .htaccess file. Edit it with any text editor and add this code deny all IP addresses from viewing a site or folder. order allow,deny deny from all You can also deny a range of IPs or one particular IP [...]
Force www in your url using the .htaccess
To force your domain name to use www, you are able to add the following code to the .htaccess file in the document root for that domain. RewriteCond %{HTTP_HOST} ^domain.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] In the case of Randomlinux.com, if we wanted to make the URL www.randomlinux.com in the address bar all the time, [...]
