My client's domain name points to /public_html; his website is at /public_html/wp. I have a .htaccess that redirects to /public_html/wp:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?somedmain\.com$
RewriteCond %{REQUEST_URI} !^/wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wp/$1 [L]
RewriteCond %{HTTP_HOST} ^(www\.)?somedmain\.com$
RewriteRule ^$ /wp/ [L]
However, when the user navigates to a page, the url is displayed as somedmain.com/wp/permalink.
I've been trying to figure how to hide the "wp" in the url; is that possible?
Thanks for any hints....
There is no need for redirection. It can be achieved directly in Wordpress.
The way to have a WP install with the core files in one directory, but show another directory in the browser's address bar, is described below:
In General Settings there are 2 URLs, WordPress Address (URL) and Site Address (URL):
The whole process is explained in this document Giving_WordPress_Its_Own_Directory.
For this example, the current WP install is at
http://example.com/wp
and the address to enter and show in the browser's address bar ishttp://example.com
.http://example.com
in this case. NO trailing slash..htaccess
andindex.php
files fromhttp://example.com/wp
tohttp://example.com
.index.php
athttp://example.com
and replace:require('./wp-blog-header.php');
withrequire('./wp/wp-blog-header.php');
6. Login using
http://example.com/wordpress/wp-admin/
.7. Go to the permalinks settings to update the Permalink structure.
That's all. The WP blog is accessed at
http://example.com
from now on..