views:

95

answers:

2

I have recently moved my blog from one serever to another. I am now unable to restore my permalink structure.

Now my permalink strucure has become /?p=123. Whenever, I try to change it to any other custom permalink structure, it throws 404 for all the posts. Check the blog at http://microreviews.org I have been forced to make the permalink structure as /?p=123. All the entries from search engines are however on the old structure /%postname%/

None of the plugins for the same seem to work and I am stuck with the ?p=123 structure.

What should I do?

+1  A: 

Assuming you're on Apache server:

  • You don't have the .htaccess file on the new server, or
  • the new server doesn't have mod_rewrite turned on, or
  • the new server ignores the .htaccess files, or
  • any combination of the above :)
robertbasic
Now when I did put the .htaccess of the old installation, I am getting a 500 error.
pallab
check apache's error logs. make sure you have mod_rewrite turned on and AllowOverride NOT set to None in httpd.conf (or wherever is the config file for that vhost).
robertbasic
A: 

The other option instead of using .htaccess (although Wordpress is built around modifying that file) you can take the contents of the .htaccess file and add them to a directive in your httpd.conf (or virtual host config file). This approach requires more access to your apache installation (i.e. it might not work with some hosting solutions), but according to the Apache httpd documentation it's more secure and less work on the server since apache will scan every directory for .htaccess files each time a page is accessed and it will re-load the .htaccess file(s) every time the page is accessed as well. If the access is put into the server config then it is loaded once at apache start-up (or on a server reload) and that's it.

For example: If your .htaccess file contained the following for the /www/htdocs/example directory

AddType text/example .exm

Then the following in your httpd.conf file would be equivalent

<Directory /www/htdocs/example>
AddType text/example .exm
</Directory>

The approach of editing your main configuration instead of .htaccess does not require that you specify AllowOverride to something other than None.

In this case, you'll still need mod_rewrite enabled for permalinks to work correctly.

BrionS