Forum Moderators: phranque
http://www.example.com/poker-forum/588085/1/NLHU50_Deep:_Turn_with_Set_on_4-Straight.html into http://www.example.com/poker-forum/588085/NLHU50_Deep:_Turn_with_Set_on_4-Straight.html
The large number is the topic id and the short ('1') is the page id, but i wish to have only the topic id..
How could i do that?
Thanks in advance
[edited by: jdMorgan at 5:32 pm (utc) on Oct. 21, 2008]
[edit reason] Please use example.com. [/edit]
DirectoryIndex index.php
RewriteRule ^/poker-forum/(.*)/(.*)\.html$ /poker-forum/id=$1/$sec=$2 [L,NC]
RewriteCond %{QUERY_STRING} ^id=([^0-9&]+)\&sec=([^0-9&]+)$
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule .* http://www.example.com/%2.html? [R=301,L]
But doesn't work properly, basically i need to transform the url without the page id
Thanks
[edited by: jdMorgan at 5:33 pm (utc) on Oct. 21, 2008]
[edit reason] Please use example.com. [/edit]
(.*) in the first line is better done with two lots of ([^/]) or somesuch for processing efficiency. You should move the rewrite (the very first line) to be the very last line. Rewrites should always come after all the redirects.
You need to swap the order of the QUERY_STRING and REQUEST_URI lines because the %2 can only be picked up if it is on the line directly following the place where it was generated.
The leading / on the RewriteRule is not required if this is a rule in your .htaccess file.
Give that a go and report back.