I want all urls after the 3rd dot to redirect to a url without the dot.
for example:
Redirect http://www.example.com./lots-of-urls-like-these/ to this: http://www.example.com/lots-of-urls-like-these/
The dot after com should always be removed.
Hope u can help.
jdMorgan
12:21 pm on Oct 15, 2010 (gmt 0)
This is a valid "Fully Qualified Domain Name" or "FQDN" format.
You may also get requests like http://www.example.com:80/lots-of-urls-like-these/ and/or http://www.example.com.:80/lots-of-urls-like-these/
Simple enough to take care of these on most servers... What have you tried so far? Do you intend to put a fix into your .htaccess file, and if so, do you have any other working server config code in it? Does this site use (or plan to use) any other subdomains in addition to the current "www"?
Jim
getoffmyisland
12:51 pm on Oct 15, 2010 (gmt 0)
I've just tried this: RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} somefolder RewriteRule ^(.*)$ [example.com...] [R,L] ,but this is not at all what i want to do.
Yes i intent to put it in .htaccess. Yes i have working config code, non-www to www redirect, redirects to take away index.php and a couple of normal Redirect 301's.
No there's no other subdomains other than www. and dont intent to use any other subdomains
getoffmyisland
12:59 pm on Oct 15, 2010 (gmt 0)
I found these 404's while running a scan to check for broken links, i'm scared google picks it up as well, site is a CMS
jdMorgan
2:00 pm on Oct 15, 2010 (gmt 0)
Replace your existing "non-www to www" redirect with a more robust rule:
This rule redirects if the hostname is not blank and if it is not *exactly* "www.example.com". It therefore catches casing errors, FQDN-format domains, and appended port numbers as previously described.
The "blank exclusion" is for HTTP/1.0 (and prior) requests. If the hostname is blank, then the request is HTTP/1.0, and trying to redirect it will result in an infinite loop, since true HTTP/1.0 requests will always have a blank hostname. Therefore, the embedded blank exclusion is used to prevent this potential loop.
Be sure your rules are in the correct order, as this is critical to success: [webmasterworld.com...]
Jim
getoffmyisland
12:33 pm on Oct 19, 2010 (gmt 0)
hey jim,
This rule is a very good replacement for the normal "non www rule" i always used.
For .co.za domains, the condition will look so, (www\.example\.co\.za)?$
and after a big struggle i managed to get the rules in the correct order, yes, very critical to success.