Redirecting a domain to a subfolder using .htaccess.

Tags: .htaccessdomainmod_rewriteRedirectsubdomain

Published on: July 29, 2009 by Sharafuddin M.A

Redirecting a domain to a subfolder using .htaccess.


To redirect domain to a subfolder you can create  a new .htaccess file in the document root of the domain.

Then Edit .htaccess file and include the following entries:

RewriteEngine On

Options +FollowSymlinks

RewriteBase /

RewriteCond %{HTTP_HOST} www.domainname [OR]

RewriteCond %{HTTP_HOST} domainname

RewriteCond %{REQUEST_URI} !subfolder/

RewriteRule ^(.*)$ subfolder/$1 [L]

Category : Apache, cPanel, Howtos, Linux, Troubleshooting

Sharafuddin M.A

Sharafuddin M.A

Sharaf got immense interest and knowledge in implementing custom application and security solutions. He is highly competent in identifying and resolving security vulnerabilities, security breaches, hacked server recovery and server hardening. This soft spoken guy loves to watch movies and hanging out with friends.

You may also read:


Add new commentSIGN IN

Let's Connect


Your Cart

Cart is empty.

Send this to a friend