Hello all!
First post but a long time lurker. Much respect goes out to jdMorgan as I have used their information more times then I can count.
Anyway, I am in the process of converting my static HTML pages over to WordPress. Everything was fine until I started deleting the old pages off of the web server and the URL's, instead of redirecting them out of my .htaccess files, are throwing a 404.
My WP is installed in /wp/ directory.
My redirect URL .htaccess is in root
The redirects work as long as the old .htm file is still located on the server. If it was deleted, WP returns a 404.
I am attempting to avoid adding a plugin that redirects pages as I would have to add in 3000 or so URL's in the plugin when I already have redirects in place...
I am using the following code in /wp/ directory:
# BEGIN WordPress
RewriteEngine on
#
# Unless you have set a different RewriteBase preceding this
# point, you may delete or comment-out the following
# RewriteBase directive:
RewriteBase /
#
# if request is for image, css, or js file
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|css|js|ico|png)$ [NC,OR]
# or if URL deals with my old static pages
RewriteCond %{REQUEST_FILENAME} \.(htm|html)$ [NC,OR]
# or if URL resolves to existing file
RewriteCond %{REQUEST_FILENAME} -f [OR]
# or if URL resolves to existing directory
RewriteCond %{REQUEST_FILENAME} -d
# then skip the rewrite to WP
RewriteRule ^ - [S=1]
# else rewrite the request to WP
RewriteRule . /index.php [L]
#
# END wordpress
I have my standard redirects located in root.
This code is as recommended in another thread. I then added a "ignore .htm and .html" files in an attempt to fix this but it is not ignoring them as I hoped.
I tried putting the rewrite rules in the /wp/.htaccess file instead of root and that did not work.
Am I just chasing my tail? Thanks in advance for any direction you can offer me.