Forum Moderators: phranque

Message Too Old, No Replies

wordpress mod rewrite problem.

         

shabniggurat

6:57 pm on Feb 29, 2008 (gmt 0)

10+ Year Member



hi,

I have a wordpress blog that I want to have my links rewritten.

[mydomain.com...]

instead of the default tubepress_id string only. I want to include the
title because for SEO purposes.

I want my final permalinks to my youtube videos to be like this:
[mydomain.com...]

I tried mod_rewrite to do this but failed.

Here is my wordpress default .htaccess:
------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteRule ^/vids/(.*)/(.*) /vids/?tubepress_id=$1&title=$2
------

The last line shows the rule i was trying to accomplish but it directs
my to a 404 page so I guess my ruleset is wrong.

Can someone help me with this? Thanks in advance.

jdMorgan

4:53 am on Mar 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Corrections to rule pattern for use in /htaccess and improved matching efficiency, added [L] flag:
 
RewriteRule [b]^vi[/b]ds/[^/]+/([^/]+)$ /vids/?tubepress_id=$1&title=$2 [L]

Put this rule ahead of the WP rewriterule - and you can remove the <ifModule> </IfModule> container tags -- If WP is working, then this container isn;t really doing anything for you.

Jim