![]() |
Wordpress .htaccess and PermalinksWhen you enable "pretty permalinks" the .htaccess file should be modified by Wordpress. So what happens if it doesn't appear to be working and what should it contain: This first step is to check that you have a .htaccess file in the directory that contains you WordPress install. When I installed mine on my local server I didn't have one. You could create one manually which is what I did. But before you put anything in it make sure that your server will read it. To do this put rubbish in it. If the server reads it but can't understand it then it will give a server 500 error. If you don't get a server error then the server isn't reading it. This is exactly what happened to me. The reason mine wasn't being read (and that Wordpress wan't creating it) was because the AllowOverride directive in the httpd.config file was set to none. You need to set it to ALL.-- AllowOverride All Because it appears multiple times in the httpd.config file you need to do it for each occurrence. Note: this is only applicable if you have full admin permissions to the Apache server. Another reason maybe that Wordpress doesn't have sufficient permissions to create/edit it. You must chmod the .htaccess file to 666 .When finished you should change the permissions to something stronger like 660 or 644. This is what it should contain with a brief explanation:
RewriteEngine On-- This turn the rewrite engine on RewriteBase /wordpress/ ---Sets the base address. in my case wordpress is installed in a directory called wordpress. If you install direct in the root directory then it would be..RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f These two lines check to see if the requested page corresponds to a physical file. It shouldn't as the pages are stored in the database. See wordpress index.php for details. Therefore if they both evaluate as true then the rewrite rule is processed. RewriteRule . index.php [L] This redirect everything through the index.php file. So a request for http://blog.copeconsulting.co.uk/ppc/adwords-keyword-tool/ gets translated to a request for: http://blog.copeconsulting.co.uk/index.php/ppc/adwords-keyword-tool/ But the visitor/search engine doesn't see it. Note: the Rewrite rule you may see as: RewriteRule .* index.php [L] RewriteRule ^(.*)$ index.php [L] They all appear to work
Resources and Related articles: |
|||
|