Forum Moderators: phranque
RedirectMatch 301 /tinyredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /littleredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /bigredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /massiveredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /tinygreenwidgets/(.*) http://www.example.com/allgreenwidgets/$1 [R=301,L]
RedirectMatch 301 /littlegreenwidgets/(.*) http://www.example.com/allgreenwidgets/$1 [R=301,L]
RedirectMatch 301 /bigrgreenwidgets/(.*) http://www.example.com/allgreenwidgets/$1 [R=301,L]
RedirectMatch 301 /massivegreenwidgets/(.*) http://www.example.com/allgreenwidgets/$1 [R=301,L]
RedirectMatch 301 /tinybluewidgets/(.*) http://www.example.com/allbluewidgets/$1 [R=301,L]
RedirectMatch 301 /littlebluewidgets/(.*) http://www.example.com/allbluewidgets/$1 [R=301,L]
RedirectMatch 301 /bigrbluewidgets/(.*) http://www.example.com/allbluewidgets/$1 [R=301,L]
RedirectMatch 301 /massivebluewidgets/(.*) http://www.example.com/allbluewidgets/$1 [R=301,L]
Is there not a way of putting the redwidgets for example into one command to redirect to allredwidgets?
RedirectMatch 301 /tinyredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /littleredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /bigredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /massiveredwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RedirectMatch 301 /(tiny|little|big|massive)redwidgets/ http://www.example.com/allredwidgets/ RewriteRule (tiny|little|big|massive)redwidgets/(.*) http://www.example.com/allredwidgets/$2 [R=301,L] [edited by: not2easy at 6:22 am (utc) on Mar 5, 2017]
[edit reason] typo [/edit]
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^(.*)/(.*)/page-(.*).html$ /?seo_county&country=$1&county=$2&pag=$3 [S=3]
RewriteRule ^(.*)/page-(.*).html$ /?seo_country&country=$1&pag=$2 [S=3]
RewriteRule ^(.*)/(.*)/$ /?seo_county&country=$1&county=$2 [S=1]
RewriteRule ^(.*)/$ /?seo_country&country=$1
RewriteRule ^(.*)/(.*)/(.*)-(.*).php$ /?seo_product&country=$1&county=$2&name=$3&town=$4
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(html|php)$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(html|php)$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301]
RewriteRule ^(.*)/(.*)/page-(.*).html$ /?seo_county&country=$1&county=$2&pag=$3 [S=3]
RewriteRule ^(.*)/page-(.*).html$ /?seo_country&country=$1&pag=$2 [S=3]
RewriteRule ^(.*)/(.*)/$ /?seo_county&country=$1&county=$2 [S=1]
RewriteRule ^(.*)/$ /?seo_country&country=$1
RewriteRule ^(.*)/(.*)/(.*)-(.*).php$ /?seo_product&country=$1&county=$2&name=$3&town=$4 RewriteRule ^(red|blue|green)foobar.html http://www.example.com/allmyfoobars.html [R=301,L] (.*) at the beginning or the middle of a pattern can be optimised a LOT. Use ([^/]+)/ or ([^/-]+)- or ([^/.]+)\. as appropriate. RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(html|php)$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301]
[edited by: phranque at 12:46 am (utc) on Apr 21, 2013]
[edit reason] context [/edit]
The site is a php mysql database site, no physical directories are used
RewriteRule (tiny|little|big|massive)redwidgets/(.*) http://www.example.com/allredwidgets/$1 [R=301,L]
RewriteRule ^directory/fat(red|blue|green)widgets/(.*) http://www.example.com/directory/allfatwidgets/$1[R=301,L]
[edited by: phranque at 12:57 am (utc) on Apr 21, 2013]
[edit reason] point of order [/edit]