Forum Moderators: phranque
<IfModule mod_rewrite.c>
Options +FollowSymlinks
#### activate rewrite engine ####
RewriteEngine on
#### we are in the root ####
Rewritebase /
#### BBQ section ####
#### 410 removed categories - categories being deleted completely - letters c - s represent actual folder names within bbq/the-bbq/ ####
RewriteRule ^bbq/the-bbq/(new-the-for-2014|c|f|g|m|o|p|q|r|s)(/(index\.html)?)?$ - G
#### Category pages - bbq/the-bbq being moved to /the-bbq & others being moved to subfolders of /the-bbq/ ####
RewriteRule ^bbq/the-bbq\.html example.com/the-bbq.html [R=301,L]
RewriteRule ^bbq/(the-gas-bbq|the-charcoal-bbq|the-q-bbq|the-smokey-mountain|the-accessories)\.html example.com/the-bbq/$1.html [R=301,L]
#### Real subdirectories - being moved to subdirectories of /the-bbq/####
RewriteRule ^bbq/([^./]+)(/index\.html)?$ http://example.com/the-bbq/$1/ [R=301,L]
#### Product and info pages - being moved to the root / ####
RewriteRule ^bbq/([^/]+)$ http://example.com/$1 [R=301,L]
#### All remaining material i.e. stuff in subfolders being moved to subfolders of /the-bbq ####
RewriteRule ^bbq/(.*) http://example.com/the-bbq/$1 [R=301,L]
#### Shop section ####
#### 410 removed categories - categories being deleted completely ####
RewriteRule ^shop/(covers|caravan-and-camping|garden-furniture(/leisure-garden-furniture)?)(/(index\.html)?)?$ - [G]
#### Category pages - being moved to 2 different places ####
RewriteRule ^shop/(garden-furniture|garden-ornaments)\.html example.com/$1/$2.html [R=301,L]
RewriteRule ^shop/outside-lighting\.html example.com/garden-furniture/outside-lighting/$1.html [R=301,L]
#### Real subdirectories - being moved to 2 different places ####
RewriteRule ^shop/(garden-furniture|garden-ornaments)$([^./]+)(/index\.html)?$ http://example.com/$1/$2/ [R=301,L]
RewriteRule ^shop/outside-lighting$([^./]+)(/index\.html)?$ http://example.com/garden-furniture/outside-lighting/$1/ [R=301,L]
#### Product and info pages - being moved to the root / ####
RewriteRule ^shop/([^/]+)$ http://example.com/$1 [R=301,L]
#### All remaining material i.e. stuff in subfolders - being moved to 2 different places ####
RewriteRule ^shop/(garden-furniture|garden-ornaments)/(.*) http://example.com/$1/$2 [R=301,L]
RewriteRule ^shop/outside-lighting/(.*) http://example.com/garden-furniture/outside-lighting/$1 [R=301,L]
#### Artificial Plants section ####
#### 410 removed categories - categories being deleted completely ####
RewriteRule ^artificial_plants/new-for-2014(/(index\.html)?)?$ - [G]
#### Category pages - moving from /artificial_plants/ to /artificial-plants/ ####
RewriteRule ^artificial_plants/(flowering-artificial-plants|artificial-orchids|artificial-hanging-baskets|foliage-artificial-plants|artificial-trees|artificial-topiary|pot-and-planters)\.html example.com/artificial-plants/$1.html [R=301,L]
#### Real subdirectories - moving from /artificial_plants/ to /artificial-plants/ ####
RewriteRule ^artificial_plants/([^./]+)(/index\.html)?$ http://example.com/artificial-plants/$1/ [R=301,L]
#### Product and info pages - moving to the root / ####
RewriteRule ^artificial_plants/([^/]+)$ http://example.com/$1 [R=301,L]
#### All remaining material i.e. stuff in subfolders - moving from /artificial_plants/ to /artificial-plants/ ####
RewriteRule ^artificial_plants/(.*) http://example.com/artificial-plants/$1 [R=301,L]
#### Homeware section - being deleted completely ####
RewriteRule ^homeware - [G]
</IfModule>
Is there a way to copy the product url from the /homeware store and create a 410 for all of them?
homeware/%{REQUEST_URI} homeware/$1 (the-gas-bbq|the-charcoal-bbq|the-q-bbq)
the-(gas|charcoal|q)-bbq the-\w+-bbq the-[^./]+ RewriteRule ^bbq/(the-[^./]+\.html) http://example.com/the-bbq/$1 [R=301,L] #### Real subdirectories - being moved to subdirectories of /the-bbq/####
RewriteRule ^bbq/([^./]+)(/index\.html)?$ http://example.com/the-bbq/$1/ [R=301,L]
^bbq/([^./]+)(/(index\.html)?)?$ RewriteRule ^shop/(garden-furniture|garden-ornaments)\.html example.com/$1/$2.html [R=301,L]
RewriteRule ^shop/garden-(furniture|ornaments)\.html http://example.com/garden-$1.html [R=301,L] #### Real subdirectories - being moved to 2 different places ####
RewriteRule ^shop/(garden-furniture|garden-ornaments)$([^./]+)(/index\.html)?$ http://example.com/$1/$2/ [R=301,L]
RewriteRule ^shop/outside-lighting$([^./]+)(/index\.html)?$ http://example.com/garden-furniture/outside-lighting/$1/ [R=301,L]
#### Category pages - moving from /artificial_plants/ to /artificial-plants/ ####
RewriteRule ^artificial_plants/(flowering-artificial-plants|artificial-orchids|artificial-hanging-baskets|foliage-artificial-plants|artificial-trees|artificial-topiary|pot-and-planters)\.html example.com/artificial-plants/$1.html [R=301,L]
RewriteRule ^artificial_plants/([^./]+\.html) example.com/artificial-plants/$1 [R=301,L] RewriteRule ^artificial_plants/([^./]+)\.html example.com/artificial-plants/$1.html [R=301,L] Yikes. I assume there are too many different productnames to list them individually?
(Don't look at me. I only speak three words of php. But there's a subforum.)
Will there be other URLs in any of these four directories that are not going away?
if you are moving everything that started out as /bbq/the-something:
RewriteRule ^bbq/the-bbq\.html example.com/the-bbq.html [R=301,L]above this allow it to work?
Cut-and-paste error?
Is the $ in the middle of each pattern simply a typo for / slash?
If the entire content of /artificial_plants/ is moving to /artificial-plants/ you don't need to spell out the filenames.
I think that's everything. It looks as if you'll end up with three almost-identical groups of rules: one for /bbq/ one for /shop/ and one for /artificicial_plants/