Please wait while we load your page...
 

Announcements

HTACCESS Magic :: Page 8







Results 15 to 16 of 16

Rewrite URL With WWW

The following Rewrites will rewrite your site URLs without www with www:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]


Alternately, you rewrite without www:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]


Note 1: To use Rewrite, (1) site must be hosted on an Apache web server, (2) mod_rewrite module must be compiled into Apache, and (3) mod_rewrite must be enabled for your domain.
Note 2: R=301 is a permanent redirect, and is the most efficient and "Search Engine Friendly" method for redirection. Alternatively, you can use R=302 for temporary redirect if the redirect is not permanent.


Last Revised: 2015-07-02

Unpassword Protect Subdirectory

The following code will "un-password protect" a subdirectory inside a password protected directory:

satisfy any

Simply add the line to a .htaccess file in the subdirectory you want to remove password protection.

Why? There can be many reasons. Recently we had a client who runs an adult paysite. For convenience and simplicity, he wanted to use the content thumbnails in the password protected members area in his front end as previews. So, we used this trick to make it possible. Note that any subdirectories of the directory that contains this .htaccess will also be open (publicly accessible ) to all. So, use with caution . You can password protect the subdirectories by coping the Auth lines from your top .htaccess file to the .htaccess in the nested subdirectory(ies). But, it is simpler to just make the directory (that you want publicly accessible in a password protected directory) not subdivided into password protected subdirectories.


Last Revised: 2015-07-01



Live Chat Not Available