Ads

May 12, 2013

Redirect The Sub Domain To a Sub Folder with .htaccess


In this post I want to explain " How to redirect the sub domain to a sub folder with .htaccess". I had implemented this for labs.9lessons.info and demos.9lessons.info. I hope it is useful for you.

Redirect The Sub Domain To a Sub Folder with .htaccess

Example .htaccess code
You have to replace your sub domain and sub folder name.
RewriteEngine On

RewriteCond %{HTTP_HOST} ^demos\.9lessons\.info$
RewriteCond %{REQUEST_URI} !^/demos/
RewriteRule (.*) /demos/$1

RewriteEngine On

RewriteCond %{HTTP_HOST} ^labs\.9lessons\.info$
RewriteCond %{REQUEST_URI} !^/labs/
RewriteRule (.*) /labs/$1

No comments:

Most Popular Posts