5 Replies - 1452 Views - Last Post: 20 April 2017 - 07:59 PM

#1 lrrossi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 04-May 15

Problems with .htaccess file in wordpress and 403 errors

Posted 20 April 2017 - 07:24 PM

This morning I changed the main directory name in my FTP file browser (the one above the Ďwordpressí folder) and received many 404 errors. I then updated my permalink in the admin panel, which generated a new .htaccess file.

I thought that would solve my problem, as suggested all over the internet. However, ever since thenIíve been in a constant battle with the .htaccess file. If I include it in the Ďwordpressí directory, the website doesnít display at all, so I canít access the website, not even to do administration.

However, if I delete the .htaccess file, the websites homepage and admin panel re-appear, and every other page has 404 errors.

Iíve tried updating permalinks to a default state via the admin panel, but that just re-generates a new .htaccess file which breaks the website again. Iíve tried numerous fixes to the file all day, and this is the current code I have in it:

 # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ler14/Wordpress%20implementation%201/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ler14/Wordpress%20implementation%201/wordpress/index.php [L]
</IfModule>
# END WordPress




Any help would be great, as Iíve spent 9 straight hours trying to fix this for an important university project, and am now at my ends wits!

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Problems with .htaccess file in wordpress and 403 errors

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5121
  • View blog
  • Posts: 13,790
  • Joined: 18-April 07

Re: Problems with .htaccess file in wordpress and 403 errors

Posted 20 April 2017 - 07:41 PM

Is there any particular reason you have changed the rewrite base? I have never had to do that with any WP installation. Have you tried first setting the htaccess file back to a basic one and then work it from there? Plus you really should try to avoid spaces in your directory names. They can cause problems from time to time.

Try changing the RewriteBase back to "/" and if that doesn't work, go back to the original htaccess...

# 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



Then if that doesn't work, make sure you don't have an .htaccess file higher up in the hierarchy interfering. Remember that htaccess can cascade down.

Lastly you can check out this page (if you haven't already) and it may help...

http://www.wpbeginne...r-in-wordpress/

Hope this helps! :)

This post has been edited by Martyr2: 20 April 2017 - 07:44 PM

Was This Post Helpful? 0
  • +
  • -

#3 lrrossi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 04-May 15

Re: Problems with .htaccess file in wordpress and 403 errors

Posted 20 April 2017 - 07:44 PM

View PostMartyr2, on 20 April 2017 - 07:41 PM, said:

Is there any particular reason you have changed the rewrite base? I have never had to do that with any WP installation. Have you tried first setting the htaccess file back to a basic one and then work it from there? Plus you really should try to avoid spaces in your directory names. They can cause problems from time to time.

Try changing the RewriteBase back to "/" and if that doesn't work, go back to the original htaccess...

# 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



Then if that doesn't work, make sure you don't have an .htaccess file higher up in the hierarchy interfering. Remember that htaccess can cascade down. :)/>


Hi,

I've tried going back to the suggested base file, and found it on the internet. It didn't work sadly. This was the .htaccess file which was generated by wordpress. I have also got the following lines of code in my wp-config.php file :

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');


Was This Post Helpful? 0
  • +
  • -

#4 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5121
  • View blog
  • Posts: 13,790
  • Joined: 18-April 07

Re: Problems with .htaccess file in wordpress and 403 errors

Posted 20 April 2017 - 07:47 PM

Well, I edited my previous post to include a link to several ideas about how to fix it. As they suggest it could be a number of issues including file permissions or installed plugins. Have you tried to deactivate your plugins and see if that makes a difference?
Was This Post Helpful? 0
  • +
  • -

#5 lrrossi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 04-May 15

Re: Problems with .htaccess file in wordpress and 403 errors

Posted 20 April 2017 - 07:51 PM

View PostMartyr2, on 20 April 2017 - 07:47 PM, said:

Well, I edited my previous post to include a link to several ideas about how to fix it. As they suggest it could be a number of issues including file permissions or installed plugins. Have you tried to deactivate your plugins and see if that makes a difference?


Thanks its much appreciated :)! I have changed the file permissions and that didn't seem to work either. I haven't tried uninstalling plugins but that seems like my best move for tomorrow if nothing else solves it, and perhaps even re-installing wordpress completely and putting my content over (if that isn't too much of a hassle). It does seem to be a problem with the .htaccess file, but maybe my stubbornness on this has stopped me solving it lol. Oh well, the problem was self made by changing a directory name, what I'd do to take time back 12 hours :(
Was This Post Helpful? 0
  • +
  • -

#6 lrrossi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 04-May 15

Re: Problems with .htaccess file in wordpress and 403 errors

Posted 20 April 2017 - 07:59 PM

View Postlrrossi, on 20 April 2017 - 07:24 PM, said:

This morning I changed the main directory name in my FTP file browser (the one above the Ďwordpressí folder) and received many 404 errors. I then updated my permalink in the admin panel, which generated a new .htaccess file.

I thought that would solve my problem, as suggested all over the internet. However, ever since thenIíve been in a constant battle with the .htaccess file. If I include it in the Ďwordpressí directory, the website doesnít display at all, so I canít access the website, not even to do administration.

However, if I delete the .htaccess file, the websites homepage and admin panel re-appear, and every other page has 404 errors.

Iíve tried updating permalinks to a default state via the admin panel, but that just re-generates a new .htaccess file which breaks the website again. Iíve tried numerous fixes to the file all day, and this is the current code I have in it:

 # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ler14/Wordpress%20implementation%201/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ler14/Wordpress%20implementation%201/wordpress/index.php [L]
</IfModule>
# END WordPress




Any help would be great, as Iíve spent 9 straight hours trying to fix this for an important university project, and am now at my ends wits!

Thanks.


I did mean to mention that the error 403 comes up with .htaccess included in the 'wordpress' folder. But error 404 comes up when it is deleted from the folder (just the homepage and admin area display). Either way, with or without the file causes problems.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1