View Full Version : Wordpress in Folder - Best way to redirect domain?

07-03-2015, 11:46 AM
I have a westhost preferred reseller account.

The main domain is mendla.com I have a couple of other sites on the account. Those are in folders under \sites.

I intend to create a site for Mendla.com using wordpress. I didn't want all of the wordpress files and folders under the root so I put them under mendla.com/wp.

So far that is working OK.

I want the wordpress installation to be the mendla.com site. Can I set up a redirect in htaccess so that requests for Mendla.com or www.mendla.com are directed to the wordpress site at mendla.com/wp? Or is there some better way of doing this???



07-04-2015, 06:31 AM
Well personally I would move Wordpress to your main folder. Easier to maintain and less likely to run into issues that way.

You should be able to us htaccess though. In fact if I recall Worpress uses htaccess to process all calls through the program. Most likely looks something like this.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

You can try and move that to your main directory. I think changing the last line to:

RewriteRule . /wp/index.php [L]
should get you where you want.

The other thing I've done for CMS's like this is copy the index.php file to the main along with the .htaccess file unchanged. The only problem with that is you normally have to dig into the config files and alter some things in the copied index.php file. For example CMS well often base the config of where files are off of where the index.php is located. So I've had to actually hardcode those configurations into my index.php file that I've moved. Not all CMS's allow for this overide but I think Wordpress does, I am just not sure what they are.

So again bottom line... just install WP in your main directory. You'll be happier in then end and have less headaches. :)