...

View Full Version : htaccess rewrite help.



tamilsweet
07-26-2008, 08:58 AM
Hi all,
I'm trying to write a rewrite rule with no luck.

The url
http://www.mysite.com/play/play-12-what-do-you-like-to-play.html

needs to be redirected to
http://www.mysite.com/play/play.php?gameid=12

Its a wordpress site. I just add the lines in Red.

I tried the following rewrite.


# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#RewriteRule ^play/play-([0-9]+)-([a-z0-9\-]+)\.html /play/play.php?id=$1 [NC]
RewriteRule ^(.*)/play/play-([0-9]+)-(.*)$ $1/play/play.php?id=$2 [NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

tamilsweet
07-26-2008, 02:34 PM
Hi all,
I'm trying to write a rewrite rule with no luck.

The url
http://www.mysite.com/play/play-12-what-do-you-like-to-play.html

needs to be redirected to
http://www.mysite.com/play/play.php?gameid=12

Its a wordpress site. I just add the lines in Red.

I tried the following rewrite.


# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#RewriteRule ^play/play-([0-9]+)-([a-z0-9\-]+)\.html /play/play.php?id=$1 [NC]
RewriteRule ^(.*)/play/play-([0-9]+)-(.*)$ $1/play/play.php?id=$2 [NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress



Added L(for last) to the rule.


RewriteRule ^play/play-([0-9]+)-([a-z0-9\-]+)\.html /play/play.php?id=$1 [NC, L]



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum