Where do I write Custom Rewrite rules?
-
I recently moved the contents of a custom webapp into WordPress, the permalinks and such are working great with the stock htaccess file below:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>However, in my application, I had links such as:
custom.php?link=20061031
Now, I tried adding:
RewriteRule ^custom\.php\?link=20061031$ /2007/01/old-2006-10-31-entry
/2007/01/old-2006-10-31-entry exists, and works if I access it directly. However, depending on where I put this rewrite rule, I either end up with WP’s 404 or I end up with Internal Server errors which the error log suggests an endless redirect.
So, given that custom.php obviously doesnt exist anymore, how do I write this rule and where would I place it in the above htaccess?
Thanks in advance for any advice.
- The topic ‘Where do I write Custom Rewrite rules?’ is closed to new replies.