Hey guys, I'm trying to implement one of the answers I got to another question I asked on here a couple days ago. You can find the original question here: http://stackoverflow.com/questions/1515639/modrewrite-clarification-question-only-for-dynamic-urls
The most helpful answer and the one I'm modeling the implementation after is as follows:
I'm guessing the answer meder gave is the one you're looking for but technically you can create a static map file to redirect a set of title strings to ids and it doesn't have to execute an external prg executable:
RewriteMap static-title-to-id txt:/tmp/title_to_id.txt RewriteRule ^/health-and-fitness-tips/(.*)/ /health-and-fitness-tips/${static-title-to-id:$1}/ [L]
with the contents of the /tmp/title_to_id.txt file something like this:
how-do-I-lose-10kg-in-12-weeks 999 some-other-title 988 and-another 983
Ok enough background. My .htaccess file currently has the following in it:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Its a typical wordpress permalink customization. However, when I try to add rules similar to those presented in the selected answer above, I get an internal server error.
This is my .htaccess file when I get the internal server error:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteMap static-title-to-id txt:/tmp/title_to_id.txt
RewriteRule ^/health-and-fitness-tips/(.*)/ /health-and-fitness-tips/${static-title-to-id:$1}/ [L]
</IfModule>
I'm hoping my problem is something simple, like a rule conflict. If you can see an error or can provide some direction here, it would be much appreciated.