Redirect apache to your wordpress install

We can redirect our ‘localhost’ site to ‘localhost/blog’ on the server using the Apache Redirect Directive.

First, create/edit the .htaccess file in your web root directory. This is usually “/var/www/html”.

sudo pico /var/www/html/.htaccess

Add this line, replacing ‘example’ with your domain name and ‘blog’ with the directory you want to redirect to:
Redirect / http://example.com/blog

Now, all you need to do is restart apache2:
sudo /etc/init.d/apache2 restart

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s