Where should .htaccess file be located?
-
Hi, I made the mistake to changing the Permalink settings to something other than the default in admin settings, and now all I get is 404 errors that say:
“The requested URL /myWebsiteDirectory/index.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”Now, the index.php folder is located at /myWebsiteDirectory/blog/index.php, however my .htaccess file is up a level. So I edited the .htaccess file by changing this line:
RewriteRule . /myWebsiteDirectory/index.php [L]
to this:
RewriteRule . /myWebsiteDirectory/blog/index.php [L]
but that didn’t change anything. So, now I’m wondering if the .htaccess file should be moved into the blog folder, or does it need to stay where the server put it?
Or do other lines also need to be edited in .htaccess? Here’s my entire .htaccess file as it is now:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /myWebsiteDirectory/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /myWebsiteDirectory/blog/index.php [L] </IfModule> # END WordPress
Perhaps something else needs to be changed in the file to make it work? I tried changing the RewriteBase to /myWebsiteDirectory/blog/, but that didn’t fix it either.
Does anyone know how to get rid of the error? I would be happy to change my Permalink settings back to default, if I could only get to the Dashboard. Thank you in advance!!!
- The topic ‘Where should .htaccess file be located?’ is closed to new replies.