I’m having a bit of a head scratcher with the navigation links on my website all things horror. All are returning a 404 page not found error.
I’ve added some security to my site in the form of public and private folders, all my pages for navigation are in the public folder, but I don’t think my .htaccess file is set up correctly and thus resulting in the 404 error.
All php files for navigation are in the public directory, and worked without issue before they were moved into separate folders, additionally, the index.php makes use of a file stored in the private directory which is required for the generator to work properly.
File structure is like this, on the SiteWorx platform:
html -> private,
public
.htaccess
-> public -> index.php, about.php, .htaccess
The public .htaccess is currently empty as I have honestly no idea how it really works.
The html one currently has DirectoryIndex /public/index.php
as the only value, but it seems to be working, previously it was:
# BEGIN Sitepad
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END Sitepad
php_value display_errors Off
private does not have an .htaccess file, not sure if it’s required.
The urls do work, but only with /public/ before the filename.php (Ideally I don’t want public to be visible in the url.
This is a side project of mine which I unfortunately don’t have a whole lot of time to dedicate to due to other more important things, but I would like to have it working and get a better understanding of how these things work and fix them when they do, so any help would be much appreciated.
Thank you.
Clicking on a navigation link returns a 404 error instead of the desired page. By adding /public/ to the URL before the page name it returns the desired result.
Robert Williams is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.