Forum Moderators: phranque
RewriteEngine on
# REWRITEBASE
RewriteBase /
# SPECIFIC REDIRECTS
# Migrating from ASP server: for any file ending .asp (default and template) redirects to HP with no string
RewriteRule .*asp(&.*)?$ http://www.atable.com? [R=301,L]
# for an old netlink "atable_traiteur" also
RewriteRule ^atable_traiteur/?$ http://www.atable.com? [R=301,L]
# for bad WSPC pages redirects to HP with strings
RewriteRule ^traiteur/?$ http://www.atable.com [R=301,L]
RewriteRule ^traiteur/unpublish/? http://www.atable.com [R=301,L]
# for wpsc category & page change
RewriteRule ^traiteur/buffets-et-cocktails/?$ http://www.atable.com [R=301,QSA,L]
RewriteRule ^traiteur/buffets-et-cocktails/buffets((/[^/]+)*)/?$ http://www.atable.com/traiteur/buffets$1 [R=301,QSA,L]
RewriteRule plateaux-de-canapes((/[^/]+)*)/?$ http://www.atable.com/traiteur/cocktails/plateaux-de-canapes-et-pieces-cocktail$1 [R=301,QSA,L]
# (more rules of same type)
# ADDITIONAL JIM MORGAN RULES:
# Redirect direct client requests for URL-path /index.php to / to avoid duplicate content
# with the exception of wp-admin directory
RewriteCond %{REQUEST_URI} !^/wp-admin/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|default)\.(php|html?|asp)([?#][^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|default)\.(php|html?|asp)$ http://www.atable.com/$1 [R=301,L]
# Redirect requests for non-blank, non-canonical hostnames to canonical hostname
RewriteCond %{HTTP_HOST} !^(www\.atable\.com)?$
RewriteRule ^(.*)$ http://www.atable.com/$1 [R=301,L]
# NORMAL JIM MORGAN RULES:
# if this request is for "/" or has already been rewritten to WP
RewriteCond $1 ^(index\.php)?$ [OR]
# or if request is for image, css, or js file
RewriteCond $1 \.(gif|jpg|jpeg|png|css|js|ico)$ [NC,OR]
# or if URL resolves to existing file
RewriteCond %{REQUEST_FILENAME} -f [OR]
# or if URL resolves to existing directory
RewriteCond %{REQUEST_FILENAME} -d
# then skip the rewrite to WP
RewriteRule ^(.*)$ - [S=1]
# else rewrite the request to WP
RewriteRule ^(.+)$ /index.php [L]
# END WordPress