Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine On
# Redirect index.htm/.html to '/'
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?(\?[^\ ]+)?\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://www.example.com/$1? [R=301,L]
# If not already redirected above, redirect non-canonical domain requests to the canonical domain
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# HTTP/1.1 301 Moved Permanently
RewriteRule ^widget.html|big-widgets|even-bigger-widgets|my-widgets/widget\.html? http://www.example.com/widgets-guide.html [R=301,L]
# HTTP/1.1 410 Gone
RewriteRule ^/folder/widgets\.html - [G]
# Redirect to remove multiple slashes within URL-path
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
# Redirect to remove multiple slashes before URL-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ //+([^\ ]*)
RewriteRule .* http://www.example.com/%1 [R=301,L]
Options +FollowSymLinks
RewriteEngine On
# HTTP/1.1 301 Moved Permanently
RewriteRule ^blonde.html|blonde-escorts|blonde-escort-london|london-escorts/blonde\.html? http://www.example.com/blonde-london-escorts.html [R=301,L]
RewriteRule ^brunette.html|brunette-escort-london|london-escorts/brunette\.html? http://www.example.com/brunette-london-escorts.html [R=301,L]
RewriteRule ^busty.html|busty-escorts|busty-escort-london|london-escorts/busty\.html? http://www.example.com/busty-london-escorts.html [R=301,L]
RewriteRule ^latina.html|latin-escort-london|brazilian-escort-london|london-escorts/latina\.html? http://www.example.com/latina-london-escorts.html [R=301,L]
RewriteRule ^reviews\.html? http://www.example.com/feedback.html [R=301,L]
# HTTP/1.1 410 Gone
RewriteRule ^Description|TITLE|London-Escorts-Portfolio|London_escorts_portfolio|london-escort-in-chelsea-milla|london-escort-in-paddintgon-angelina|london-escorts/aged-18-21|london-escorts/aged-22-plus|london-escorts/escorts-az\.html - [G]
RewriteRule ^links/independent-escorts-in-london|links/escort-agencies-in-london|links/linking|links/fetish|links/index|links/escort-web-site-design|links/escort-agencies-in-the-usa|links/erotic-stories\.html - [G]
RewriteRule ^banners/ - [G]
# Redirect index.htm/.html to '/'
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?(\?[^\ ]+)?\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://www.example.com/$1? [R=301,L]
# If not already redirected above, redirect non-canonical domain requests to the canonical domain
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# Redirect to remove multiple slashes within URL-path
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
# Redirect to remove multiple slashes before URL-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ //+([^\ ]*)
RewriteRule .* http://www.example.com/%1 [R=301,L]
If I add
# Redirect to remove multiple slashes within URL-path
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
# Redirect to remove multiple slashes before URL-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ //+([^\ ]*)
RewriteRule .* http://www.example.com/%1 [R=301,L]
It fixes the two slashes problem .. but I'm guessing that's still not the correct way to do it?
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L] RewriteRule ^/folder/widgets\.html - [G] RewriteRule ^widget.html|big-widgets|even-bigger-widgets|my-widgets/widget\.html? http://www.example.com/widgets-guide.html [R=301,L] ^widget.html[OR]
big-widgets[OR]
even-bigger-widgets[OR]
my-widgets/widget\.html? Options +FollowSymLinks
RewriteEngine On
# HTTP/1.1 301 Moved Permanently
RewriteRule blonde.html|blonde-escorts|blonde-escort-london|london-escorts/blonde\.html? http://www.example.com/blonde-london-escorts.html [R=301,L]
RewriteRule brunette.html|brunette-escort-london|london-escorts/brunette\.html? http://www.example.com/brunette-london-escorts.html [R=301,L]
RewriteRule busty.html|busty-escorts|busty-escort-london|london-escorts/busty\.html? http://www.example.com/busty-london-escorts.html [R=301,L]
RewriteRule latina.html|latin-escort-london|brazilian-escort-london|london-escorts/latina\.html? http://www.example.com/latina-london-escorts.html [R=301,L]
RewriteRule reviews\.html? http://www.example.com/feedback.html [R=301,L]
# HTTP/1.1 410 Gone
RewriteRule Description|TITLE|London-Escorts-Portfolio|London_escorts_portfolio|london-escort-in-chelsea-milla|london-escort-in-paddintgon-angelina|london-escorts/aged-18-21|london-escorts/aged-22-plus|london-escorts/escorts-az\.html - [G]
RewriteRule links/independent-escorts-in-london|links/escort-agencies-in-london|links/linking|links/fetish|links/index|links/escort-web-site-design|links/escort-agencies-in-the-usa|links/erotic-stories\.html - [G]
# Redirect index.htm/.html to '/'
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?(\?[^\ ]+)?\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://www.example.com/$1? [R=301,L]
# If not already redirected above, redirect non-canonical domain requests to the canonical domain
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.?)$ http://www.example.com/$1 [R=301,L]
# Redirect to remove multiple slashes within URL-path
RewriteRule ^(([^/]+/)*)/+(.?)$ http://www.example.com/$1$3 [R=301,L]
Options +FollowSymLinks
RewriteEngine On
# HTTP/1.1 301 Moved Permanently
RewriteRule (blonde|blonde-escorts|blonde-escort-london|london-escorts/blonde)\.html? http://www.example.com/blonde-london-escorts.html [R=301,L]
RewriteRule (brunette|brunette-escort-london|london-escorts/brunette)\.html? http://www.example.com/brunette-london-escorts.html [R=301,L]
RewriteRule (busty|busty-escorts|busty-escort-london|london-escorts/busty)\.html? http://www.example.com/busty-london-escorts.html [R=301,L]
RewriteRule (latina|latin-escort-london|brazilian-escort-london|london-escorts/latina)\.html? http://www.example.com/latina-london-escorts.html [R=301,L]
RewriteRule ^reviews\.html? http://www.example.com/feedback.html [R=301,L]
# HTTP/1.1 410 Gone
RewriteRule (London-Escorts-Portfolio|Description|TITLE|banners|links/independent-escorts-in-london|links/escort-agencies-in-london|links/linking|links/fetish|links/index|links/escort-web-site-design|links/escort-agencies-in-the-usa|links/erotic-stories|links/linkingThanks|links/London-Escort-Agencies|London_escorts_portfolio|london-escort-in-chelsea-milla|london-escort-in-paddintgon-angelina|london-escorts/aged-18-21|london-escorts/aged-22-plus|london-escorts/escorts-az|london-escort-in-bayswat..|london-esco..|&usg=ALkJrhgz6MRDcFkp-kcCoKgNS9ERG-CLtQ|$myEmail|London_escorts_portfolio.htm?a=g|zoe.html?iframe=true&width=80%&height=80%)\.html? - [G]
# Return 410-Gone for myEmail URLs
RewriteRule myEmail - [G]
# Redirect index.htm/.html to '/'
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?(\?[^\ ]+)?\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://www.example.com/$1? [R=301,L]
# If not already redirected above, redirect non-canonical domain requests to the canonical domain
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# Redirect to remove multiple slashes within URL-path
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
# Redirect to remove multiple slashes before URL-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ //+([^\ ]*)
RewriteRule .* http://www.example.com/%1 [R=301,L]
# 301 redirect requests to files with no extension to same with appended .html extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\..+$
RewriteRule ^(.*)$ /$1.html [R=301,L]
Your final rule is unnecessary because it is included within the previous rule:
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
RewriteRule .* http://www.example.com/%1 [R=301,L]
Options +FollowSymLinks
RewriteEngine On
# HTTP/1.1 301 Moved Permanently
RewriteRule (blonde|blonde-escorts|blonde-escort-london|london-escorts/blonde)\.html? http://www.example.com/blonde-london-escorts.html [R=301,L]
RewriteRule (brunette|brunette-escort-london|london-escorts/brunette)\.html? http://www.example.com/brunette-london-escorts.html [R=301,L]
RewriteRule (busty|busty-escorts|busty-escort-london|london-escorts/busty)\.html? http://www.example.com/busty-london-escorts.html [R=301,L]
RewriteRule (latina|latin-escort-london|brazilian-escort-london|london-escorts/latina)\.html? http://www.example.com/latina-london-escorts.html [R=301,L]
RewriteRule ^reviews\.html? http://www.example.com/feedback.html [R=301,L]
# HTTP/1.1 410 Gone
RewriteRule ^links/(independent-escorts-in-london|escort-agencies-in-london|linking|fetish|index|escort-web-site-design|escort-agencies-in-the-usa|erotic-stories|linkingThanks|London-Escort-Agencies)\.html? - [G]
RewriteRule ^london-escorts/(aged-18-21|aged-22-plus|escorts-az)\.html? - [G]
RewriteRule ^(London-Escorts-Portfolio|London_escorts_portfolio|Description|TITLE|banners|london-escort-in-chelsea-milla|london-escort-in-paddintgon-angelina|london-escort-in-bayswat..|london-esco..|&usg=ALkJrhgz6MRDcFkp-kcCoKgNS9ERG-CLtQ|$myEmail|London_escorts_portfolio.htm?a=g|zoe.html?iframe=true&width=80%&height=80%)\.html? - [G]
# Return 410-Gone for myEmail URLs
RewriteRule myEmail - [G]
# Redirect index.htm/.html to '/'
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?(\?[^\ ]+)?\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://www.example.com/$1? [R=301,L]
# Redirect to remove multiple slashes within URL-path
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
# Redirect to remove multiple slashes before URL-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ //+([^\ ]*)
RewriteRule .* http://www.example.com/%1 [R=301,L]
# 301 redirect requests to files with no extension to same with appended .html extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\..+$
RewriteRule ^(.*)$ /$1.html [R=301,L]
# If not already redirected above, redirect non-canonical domain requests to the canonical domain
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Options +FollowSymLinks
RewriteEngine On
# HTTP/1.1 410 Gone
RewriteRule ^links/(independent-escorts-in-london|escort-agencies-in-london|linking|fetish|index|escort-web-site-design|escort-agencies-in-the-usa|erotic-stories|linkingThanks|London-Escort-Agencies)\.html? - [G]
RewriteRule ^london-escorts/(aged-18-21|aged-22-plus|escorts-az)\.html? - [G]
RewriteRule ^(London-Escorts-Portfolio|London_escorts_portfolio|Description|TITLE|banners|london-escort-in-chelsea-milla|london-escort-in-paddintgon-angelina|london-escort-in-bayswat..|london-esco..|&usg=ALkJrhgz6MRDcFkp-kcCoKgNS9ERG-CLtQ|$myEmail|London_escorts_portfolio.htm?a=g|zoe.html?iframe=true&width=80%&height=80%)\.html? - [G]
# Return 410-Gone for myEmail URLs
RewriteRule myEmail - [G]
# HTTP/1.1 301 Moved Permanently
RewriteRule (blonde|blonde-escorts|blonde-escort-london|london-escorts/blonde)\.html? http://www.example.com/blonde-london-escorts.html [R=301,L]
RewriteRule (brunette|brunette-escort-london|london-escorts/brunette)\.html? http://www.example.com/brunette-london-escorts.html [R=301,L]
RewriteRule (busty|busty-escorts|busty-escort-london|london-escorts/busty)\.html? http://www.example.com/busty-london-escorts.html [R=301,L]
RewriteRule (latina|latin-escort-london|brazilian-escort-london|london-escorts/latina)\.html? http://www.example.com/latina-london-escorts.html [R=301,L]
RewriteRule ^reviews\.html? http://www.example.com/feedback.html [R=301,L]
# Redirect index.htm/.html to '/'
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?(\?[^\ ]+)?\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://www.example.com/$1? [R=301,L]
# Redirect to remove multiple slashes within URL-path
RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
# Redirect to remove multiple slashes before URL-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ //+([^\ ]*)
RewriteRule .* http://www.example.com/%1 [R=301,L]
# 301 redirect requests to files with no extension to same with appended .html extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\..+$
RewriteRule ^(.*)$ /$1.html [R=301,L]
# If not already redirected above, redirect non-canonical domain requests to the canonical domain
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# 301 redirect requests to files with no extension to same with appended .html extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\..+$
RewriteRule ^(.*)$ /$1.html [R=301,L]
RewriteCond %{REQUEST_URI} !\..+$ RewriteRule ^([^.]+)$ http://www.example.com/$1.html [R=301,L] RewriteRule ^([^.]+)$ http://www.example.com/$1.html [R=301,L]