help with a wordpress rewrite

Discuss practical ways rearrange URLs using mod_rewrite.

help with a wordpress rewrite

Postby TheWebHead » Sun Jul 06, 2008 11:40 am

I'm trying this:

RewriteCond %{REQUEST_URI} ^/wordpress/article([0-9]+)\.html
RewriteRule (.*) http://domain.com/wordpress/?p=$1 [L,R=301]


But instead of ?p=1234 I get ?p=article1234.html

Any help appreciated...
TheWebHead
 
Posts: 12
Joined: Wed Aug 08, 2007 8:43 am

Postby richardk » Mon Jul 07, 2008 1:54 pm

(.*) is $1
([0-9]+) is %1

You should not need a RewriteCond
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^wordpress/article([0-9]+)\.html$ /wordpress/?p=$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby TheWebHead » Mon Jul 07, 2008 7:11 pm

Thanks. That worked.
TheWebHead
 
Posts: 12
Joined: Wed Aug 08, 2007 8:43 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 36 guests

cron