Home › Forums › BulletProof Security Free › 404 error on all but home page
Tagged: 404 error
- This topic has 17 replies, 5 voices, and was last updated 3 years, 6 months ago by
Gulshan Negi.
-
AuthorPosts
-
Joe Lowery
MemberMy client’s site has a WP install within a sub-folder and I’m using the following code in my .htaccess file to show linked pages:
# BEGIN WordPress RewriteEngine On RewriteBase /rhap/blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /rhap/blog/index.php [L] # END WordPress
First, I tried using the BPS .htaccess files as generated and I received 404 errors on all but the home page. Then I tried adding the custom code (all but the #BEGIN and #END lines) to the custom code section of the plug-in, but I still get 404’s. What am I doing wrong?
Thanks – Joe
AITpro Admin
KeymasterThe RewriteBase and RewriteRule are not valid. You ONLY add the actual folder name where the website is installed and NOT additional folders that are above that folder.
RewriteBase means the actual folder name where the website is installed in.
If the website is installed in the /blog folder then the RewriteBase is RewriteBase /blog/
and the RewriteRule would then be RewriteRule . /blog/index.php [L]
Joe Lowery
MemberThanks for the speedy response! So, does this look right:
RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L]
Thanks – Joe
AITpro Admin
KeymasterYes, that is correct WordPress .htaccess code for a subfolder site installed in the /blog folder. If using [obsolete-removed] did not create the correct RewriteBase then that means your WordPress General Settings are not valid.
Go to Settings >>> General and check your WordPress Address and Site Address URL’s
Example for the AIT-pro.com Blog subfolder site that is installed in the /aitpro-blog folder:
WordPress Address (URL) http: //www.ait-pro.com/aitpro-blog
Site Address (URL) http: //www.ait-pro.com/aitpro-blogAITpro Admin
KeymasterTypically you would probably not want to install a subfolder site under another subfolder site if that is what you have done. Let’s say you have a WordPress installation here: /rhap and you want to install an additional subfolder site and it will be the blog site for the /rhap site.
Your folder structure would be this…
/rhap – is the main site
/blog – is the blog for the main site…and not this /rhap/blog. You can do this I think, but it is not the recommended best site architecture.
The URL structure on the frontend of the website would be the same for both folder structures, unless of course you were doing something like this, but this is probably a very bad idea.
/main-site/another-site/blog-site
Joe Lowery
MemberOk, got it. Everything is working fine now. Thanks!
ALEX KIBET MUHINDI
ParticipantHi,
Just installed BPS pro but I get error 404 on all but my home page.
Kindly advise
AITpro Admin
KeymasterThis sounds like a common htaccess code rewriting problem or a WordPress General Settings problem. See the information above in this forum topic. Are you WordPress General Settings correct? Is your root htaccess code correct? Go to the BPS > htaccess File Editor tab page > Your Current Root htaccess File tab > copy and paste all of your root htaccess file code in your forum reply.
ALEX KIBET MUHINDI
Participant[Root htaccess file checked and then deleted by AITpro Admin]
AITpro Admin
KeymasterYour root htaccess file and code looks good. So check your WordPress General Settings and also check your WordPress Permalinks. Post your WordPress Permalink Structure in your forum reply so I can see what you are using for your Permalinks.
AITpro Admin
KeymasterActually your website is now HTTPS and not HTTP and you are not using HTTPS/SSL htaccess code in BPS Root Custom Code and your Root htaccess file. See this forum topic link below for how to add that. Also make sure your WordPress General Settings URL’s are https and not http.
ALEX KIBET MUHINDI
Participantok…It has worked.
I see the below error when I try to add products.
One or more database tables are unavailable. The database may need to be repaired.
RegardsAITpro Admin
KeymasterGreat! Glad to hear the rewrite problem with HTTPS is now fixed.
I did a Google search for that WordPress error message and found these search results below.
Alex Laxton
ParticipantI agree with admin he will give the best solution to you and hope I can also suggest valuable but I don’t have much coding knowledge.
Gulshan Negi
ParticipantHello everyone, I started a blog and recently I install an AMP plugin it works fine for me but after some days of the installation I saw some of the AMP related issues on the search console, after this, I uninstall the AMP plugin, but after this when i search some of the keyword on the internet the site appears in the search page but when i open that page it shows 404 “page does not Find” Error, i do not know why this happens and how can I solve this. Please Help.
-
AuthorPosts
- You must be logged in to reply to this topic.