Hi,
Our WP runs in a Windows server
and have a permalink format like
/index.php/%year%/%monthnum%/%day%/%postname%/
We changed this to
/%postname%/
and it works without any problem.
But the old /index.php/%year%/%monthnum%/%day%/%postname%/ URLs are throwing 404 errors. What rewrite rule should I add to web.config to redirect them properly?
Thanks,
Ravi
WP should do that for you when you change your permalink structure, unless it is unable to write to .htaccess.
I also use /%postname%/ and here is exactly what is in my auto generated .htaccess file (works fine if I enter the other structure too) -
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
duck_boy,
I am using a Windows server. So, there is no .htaccess.
I have only web.config and WP could already make the permalinks working properly.
But I could not get the old URLs to redirect to the new ones properly.
Ah, sorry - didn't twig on that bit.
As far as I know WP is designed to run on Apache, not ISS (although it clearly can), so there may be some missing functionality in relation to this. Unfortunatly I'm not an expert with ISS, but I hope you find your solution.
Please see this example and carefully review what each line does before using as is:
http://pastebin.com/MnDgNisg