500 internal server error when changing permalink to /%category%/%postname%/

你说的曾经没有我的故事 提交于 2019-12-08 04:52:51

问题


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.


回答1:


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.




回答2:


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..



来源:https://stackoverflow.com/questions/8714583/500-internal-server-error-when-changing-permalink-to-category-postname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!