Reputation: 142
I'm in a siutation where I need static pages to take over for much of a wordpress site I'm working with. I have created a /static
directory in order to hold the static pages, but I also need to keep the exiting blog visible. I have the following code in my .htaccess
file:
RewriteEngine On
RewriteRule ^blog index\.php [L]
RewriteRule ^20* index\.php [L]
RewriteRule ^$ static [L]
Going to mydomain.com/blog
or mydomain.com/2014/01/blog-post
both work, but if I try to go to mydomain.com
the URL is being redirected to mydomain.com/static
which is not what I am trying to accomplish.
Additionally, trying to visit any other page such as mydomain.com/about.php
throws a 404 error which makes me think my rewrite is entirely wrong. Essentially I want all requests except for the blog page and blog posts to be rewritten to the files in /static
Upvotes: 0
Views: 91
Reputation: 143906
You need a trailing at the end of the directory or else mod_dir and DirectorySlash
will redirect the browser to the URL with the trailing slash. So you're 3rd rule needs to be:
RewriteRule ^$ static/ [L]
Upvotes: 1