Thursday, November 21, 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 forlabs.9lessons.info and demos.9lessons.info. I hope it is useful for you.
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:

Post a Comment

Please Comment Here!

How to backup and download Database using PHP

< ?php $mysqlUserName = 'databaseusername' ; $mysqlPassword = 'databasepassword' ; $mysqlHostNa...