Prakash Raman
Prakash Raman

Reputation: 13923

How to have wordpress point to a different directory

wordpress installation is at: http://www.domain.com/mainpage

but I want people to access this via http://www.domain.com

How can I accomplish this ?

Upvotes: 0

Views: 100

Answers (2)

Chris Carson
Chris Carson

Reputation: 1845

You need to do two things (3 if you have fancy URLs).

First. Go to the settings panel in WordPress. Make the "Site Address" http://www.domain.com. Leave the "WordPress Address" alone -- it should remain http://www.domain.com/mainpage/

Second. Copy index.php from mainpage/ and place the copy in your root directory for www.domain.com. Change:

require('./wp-blog-header.php');

To:

require('./mainpage/wp-blog-header.php');

If you're using pretty URLs you may have to copy .htaccess as well -- Wordpress usually can do this for you when you change the Site Address.

Upvotes: 0

Jigar Tank
Jigar Tank

Reputation: 1774

Redirect your users from your index.php file to the path where you want them to go. using header("Location:YOUR_PATH");

Upvotes: 1

Related Questions