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 Site Address (URL) setting is the address you want people to type in their browser to reach your WordPress blog.
- The WordPress Address (URL) setting is the address where your WordPress core files reside.
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 is http://example.com
.
- Go to Settings -> General.
- In Site Address (URL), enter the directory to show:
http://example.com
in this case. NO trailing slash.
- Save changes and log out.
- Copy
.htaccess
and index.php
files from http://example.com/wp
to http://example.com
.
- Open
index.php
at http://example.com
and replace:
require('./wp-blog-header.php');
with
require('./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..