WordPress pointing home URL to subdirectory

Pointing your home site's URL to a subdirectory

In some cases, you may have a WordPress site that changes significantly every year, such as with a conference website. If you want to install each year's version of the site in a subdirectory, such as /2010, /2011, and /2012, but have the root domain (yoursite.com

) automatically redirect to a particular subdirectory (usually the latest), follow this technique:

  1. Install WordPress in a subdirectory, such as /2012.
  2. In your root folder (not the subdirectory folder), download and open your .htaccess file.
  3. Add the following to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ blog [L]
  1. In the above code, change the "YourDomain.com" value to your root domain.
  2. In the above code, change the "blog" value to the subdirectory.
  3. Save and upload the .htacess file back to your root directory.

Now when users to go your root domain (yoursite.com

), it will automatically redirect to the subdirectory you specified. When you want to redirect to a new subdirectory, such as the conference site for next year, just update the .htaccess redirect code.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to log into cPanel

cPanel is a web hosting account management tool available on all Digicom Linux hosting plans,...

Change cPanel Password or recover lost password

Requesting a New cPanel Password If you have lost or forgotten your cPanel password, you can...

Location of Script Configuration Files

Location of Script Configuration Files These paths are relative to the root of the script, not...

Connect to MySQL Database

How to Connect to the MySQL Database In order for your MySQL database to work as intended, it...

Please read before creating an Addon Domain

Please Read before Creating an Addon Domain Addon domains are handled similarly to subdomains...