Forum Moderators: phranque
example.com/index.php?TopicID=12_34_56_78&FrameID=12_34_56_78 example.com/12_34_56_78/12_34_56_78/ example.com/12-34-56-78/12-34-56-78/
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule home index.php [L]
RewriteRule ^([^/]*)/$ /index.php?TopicID=$1 [L]
RewriteRule ^([^/]*)/([^/]*)/$ /index.php?RollID=$1&FrameID=$2 [L]
RewriteRule ^([^_]*)_([^_]*_.*) $1-$2 [N]
RewriteRule ^([^_]*)_([^_]*)$ /$1-$2 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.*) $1.php [L]
example.com/index.php?TopicID=12_34_56_78&FrameID=12_34_56_78 example.com/index.php?TopicID=12-34-56-78&FrameID=12-34-56-78 example.com/12-34-56-78/12-34-56-78/ example.com/12_34_56_78/12_34_56_78/ RewriteRule _ /fixup.php [L] Are rewritten to this
<?php
$url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
$url = str_replace('_', '-', $url);
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$url);
?> Does that look right?
There is zero difference between words_separated_like_this and words-separated-like-this and the starting value of keywords in url is very low.