Home › Forums › BulletProof Security Pro › Redirect all old HTML pages to new website pages
Tagged: redirect html pages, redirect index.html
- This topic has 22 replies, 3 voices, and was last updated 9 years, 2 months ago by
AITpro Admin.
-
AuthorPosts
-
AITpro Admin
KeymasterOk I still do not know what your website architecture is and what exists in your site root .htaccess file and whether or not you have a GWIOD site or not and all the other things I would need to know to be able to assist you.
Go to the BPS System Info page and copy and paste this info (replace your actual domain name with example.com, but do NOT remove the folder and URL structure information):
WordPress Installation Folder: /wordpress/
Plugins Folder: wp-content/plugins
WordPress Installation Type: Subfolder Installation
Standard/GWIOD Site Type: GWIOD WP Site Type
WordPress Address (URL): example.com
Site Address (URL): example.com/wordpressRob
ParticipantWordPress Installation Folder: /rcms/
Plugins Folder: wp-content/plugins
WordPress Installation Type: Subfolder Installation
Standard/GWIOD Site Type: GWIOD WP Site Type
WordPress Address (URL):http://www.example.com
Site Address (URL):http://www.example.com/rcms
AITpro Admin
KeymasterOk great. Now what I need to know is are you using the standard WordPress rewrite code for GWIOD site types in your site root .htaccess file? It will look either exactly the same or very similar to this code below (make sure your RewriteBase is / and not /rcms/:
Reference: https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
Rob
ParticipantYes, that is exactly the code that is in my site root .htaccess file
AITpro Admin
KeymasterOk now depending on which host you have the correct RedirectMatch code will be either…
RedirectMatch 301 ^/index.html$ http://example.com/
…or…
RedirectMatch 301 ^/add-your-site-root-folder-name-here/index.html$ http://example.com/
…But try this first…
Add this .htaccess code directly above your WordPress Rewrite .htaccess code. This will ONLY work if you have done the other mandatory step for WordPress GWIOD site types, which is to copy your index.php file from your WordPress installation folder and edit it and add your WordPress installation folder name in that index.php file. See the GWIOD link in my previous post for instructions on how to do that.
# DIRECTORY INDEX FORCE INDEX.PHP # Use index.php as default directory index file # index.html will be ignored will not load. DirectoryIndex index.php index.html /index.php
AITpro Admin
KeymasterIf none of the things work above then there is a Server configuration problem (domain alias, forwarding, etc, DNS) going on and you will need to contact your web host to find out what the problem is.
Rob
ParticipantThat worked!!!!!
I must have missed the step to copy # DIRECTORY INDEX FORCE INDEX.PHP into my root htaccess. I can’t even begin to thank you for taking the time work through this with me. This type of thing is frustrating and I’m just not good with htaccess to begin with. You really went over the top on this one as it really wasn’t related to plugin. I just came here to make sure I was putting this in the right spot.
Thanks again,
RobAITpro Admin
KeymasterThat is not a standard WordPress step so you did not miss that anywhere – it is just something that I thought of that would logically work. Luckily it did. Logically it makes sense since the DirectoryIndex .htaccess directive is a redirect directive like the ErrorDocument .htaccess directive. Glad it worked and this is a good generall “all-purpose” type of fix that will be useful to anyone else that lands here. 😉
-
AuthorPosts
- You must be logged in to reply to this topic.