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.
-
Can you login to admin panel? Is that live site or you work on localhost? Do you have some other code in .htaccess file? If you can login to admin panel, visit Permalink settings page and then visit your site.Marko Nikolic– Marko Nikolic2012年01月03日 18:58:38 +00:00Commented Jan 3, 2012 at 18:58
-
Thank you for your reply Marko.. I am doing in my local. I dont have any other code in my .htaccess file. After putting htaccss I cant log into admin pannel also I am getting Internal server error. Do I need to make any other change in .htaccess file other than the abvoe mentioned one.Dilip Rajkumar– Dilip Rajkumar2012年01月04日 04:00:45 +00:00Commented Jan 4, 2012 at 4:00
-
Try it on a server that can handle .htaccess. There's a good chance your local server doesn't know how to use .htaccess.Jasper Kennis– Jasper Kennis2012年01月04日 22:08:46 +00:00Commented Jan 4, 2012 at 22:08
-
If I put 302 redirect or any other redirection in .htaccess file it is working. If I put this alone it is not working.Dilip Rajkumar– Dilip Rajkumar2012年01月05日 12:04:35 +00:00Commented Jan 5, 2012 at 12:04
2 Answers 2
You trying to rewrite the url two times:
- .htaccess file
- 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.
1 Comment
RewriteBase and RewriteRule lines in .htaccess were set to redirect to a subfolder (my site is on a subfolder on the server but now I provisioned a domain name for it). The lines were before # BEGIN Wordpress line and so WP didn't update them when I changed the site name in settings. WP itself was inserting and managing the correct lines after # BEGIN Wordpress . So removing these earlier lines solved the issue.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..