admin管理员组

文章数量:1420659

I have a WordPress site that is installed in a directory called cms.

I will be using a pure HTML page as my Home page, the inner pages will be using WordPress.

Let's call the website mysite

visiting mysite needs to show my plain html page.

The help I need is to hide the cms folder in the URL.

I have the following .htaccess file in my root

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?mysite$
RewriteCond %{REQUEST_URI} !^/cms/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /cms/$1 
</IfModule>

And this .htaccess in side the cms directory:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cms/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cms/index.php [L]
</IfModule>

I don't think I need to have both but that is the only way I've gotten the pages to show up without an error.

For example lets say I have a page called MyPage

With how I have things set now it is accessible at:

mysite/MyPage AND mysite/cms/MyPage

I need it to only be accessible at mysite/MyPage

While maintaining the ability to serve the static HTML page at mysite

Any advice is appreciated!

本文标签: url rewritingHelp with htaccess setup to hide WordPress Directory