500 internal server error when changing permalink

2019-05-29 09:57发布

I am getting Internal server error while changing the Permalink in wordpress. What I did was

I changed "Custom Structure" under Permalink settings and gave /%category%/%postname%/

It asked me to put a .htaccess with the following content:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase ./
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ./index.php [L]
</IfModule>

Then my site become inaccessible i am getting Internal server error. I have my mod_rewrite enabled.

Any help is greatly appreciated. Thanks in advance.

2条回答
爷的心禁止访问
2楼-- · 2019-05-29 10:31

You trying to rewrite the url two times:

  1. .htaccess file
  2. WP Permalink settings

Get rid of your .htaccess file (or comment first line)

<IfModule mod_rewrite.c>
# RewriteEngine On
RewriteBase ./
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ./index.php [L]
</IfModule>

hope this will help.

查看更多
Rolldiameter
3楼-- · 2019-05-29 10:44

Finally I figured out the problem it is because of the home entry in wp_options table.

The home value is set as ./ I dont know how it got set. When I delete it the Permalinks works perfectly. No my home entry is Blank ""

Hope it helps some one..

查看更多
登录 后发表回答