Forum Moderators: phranque
# www.myspace-help.com/Backgrounds/?page=1 to
# www.myspace-help.com/Backgrounds-1.php
RewriteRule ^([^/]+)-(\d+)\.php$ $1/?page=$2 [L,NC]
# www.myspace-help.com/Backgrounds/Saint_Patrics_Day/?page=1 to
# www.myspace-help.com/Background-Saint_Patrics_Day-1.htm
RewriteRule ^([^/]+)-([^/]+)-(\d+)\.htm$ $1/$2/?page=$3 [L,NC]
# www.myspace-help.com/Background/view.php?cat=Saint_Patrics_Day&layout=19.gif to
# www.myspace-help.com/Background-Saint_Patrics_Day-19.gif
RewriteRule ^([^/]+)-([^/]+)-([^/]+)/?$ $1/view.php?cat=$2&layout=$3 [L,NC]
And how do i 301
www.myspace-help.com/Background/view.php?cat=Saint_Patrics_Day&layout=19.gif to
www.myspace-help.com/Background-Saint_Patrics_Day-19.gif
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /Background/view\.php\?cat=Saint_Patrics_Day&layout=19\.gif\ HTTP/
RewriteRule ^Background/view\.php$ http://www.myspace-help.com/Background-Saint_Patrics_Day-19.gif? [R=301,L]
The Problem i am having is with my last line. How can i make
"www.myspace-help.com/Background-Saint_Patrics_Day-19.gif" become
www.myspace-help.com/Background-Saint_Patrics_Day-19.html
# Internally rewrite requested URL-paths like /Backgrounds-1.php to filepath /Backgrounds/?page=1
RewriteRule ^([^/-]+)-(\d+)\.php$ /$1/?page=$2 [L]
#
# Internally rewrite requested URL-paths like /Background-Saint_Patrics_Day-1.htm to filepath /Backgrounds/Saint_Patrics_Day/?page=1
RewriteRule ^([^/-]+)-([^/-]+)-(\d+)\.htm$ /$1/$2/?page=$3 [L]
#
# Internally rewrite requested URL-paths like/Background-Saint_Patrics_Day-19.gif to filepath /Background/view.php?cat=Saint_Patrics_Day&layout=19.gif
RewriteRule ^([^/-]+)-([^/-]+)-([^/]+)/?$ /$1/view.php?cat=$2&layout=$3 [L]
# Rewrite ".html" URL-path requests to view.php with ".gif" layout if .gif file physically exists
RewriteCond %{DOCUMENT_ROOT}/path-to-physical-images/$3.gif -f
RewriteRule ^([^/-]+)-([^/-]+)-([^/.]+)\.html/?$ /$1/view.php?cat=$2&layout=$3.gif [L]
#
# Rewrite "html" URL-path requests to view.php with ".jpg" layout if .jpg file physically exists
RewriteCond %{DOCUMENT_ROOT}/path-to-physical-images/$3.jpg -f
RewriteRule ^([^/-]+)-([^/-]+)-([^/.]+)\.html/?$ /$1/view.php?cat=$2&layout=$3.jpg [L]