Forum Moderators: phranque
# Externally redirect direct client requests for dynamic article URL-paths to SEO-friendly URLs
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /(index\.php)?\?view=article&art_id=([0-9]+)(#[^\ ]*)?\ HTTP/
RewriteRule ^(index\.php)?$ http://www.example.com/articles/%2 [R=301,L]
#
# Internally rewrite requests for SEO-friendly URL-paths to the index.php script with query string
RewriteRule ^articles/([0-9]+)$ index.php?view=article&art_id=$1 [L]
GET /index.php?view=article&art_id=123 HTTP/1.1
Option -MultiViews
AcceptPathInfo Off
Options +FollowSymLinks -Indexes -MultiViews [edited by: jdMorgan at 11:35 pm (utc) on Apr 30, 2010]
[edit reason] De-linked [/edit]
http://localhost/site/article/?view=article&art_id=1
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /site/(index\.php)?\?view=article&art_id=([0-9]+)(#[^\ ]*)?\ HTTP/
RewriteRule ^(index\.php)?$ http://localhost/site/article/$2 [R=301,L]
[edited by: jdMorgan at 11:26 pm (utc) on Apr 30, 2010]
[edit reason] De-linked [/edit]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /site/(index\.php)?\?view=article&art_id=([0-9]+)(#[^\ ]*)?\ HTTP/
RewriteRule ^(index\.php)?$ http://localhost/site/article/[b]%2?[/b] [R=301,L]