How to fix LinkEX and .htaccess conflicts
Last month I discussed using 301 redirects to avoid duplicate content and now I’d like to expand on that topic with something I just learned this morning. On a few of my sites, I’m using a script named LinkEX to trade text links with other sites. It seems that there is a conflict when using the 301 redirect method mentioned above with LinkEX. When I would try to login, the username/password fields would just reset. I knew the password was correct because it had been saved within Firefox. When I tried to use the password reset too, that field would just reset too.
After talking to the script creator for awhile, we figured out that this issue was caused by my .htaccess file and he provided me with a much better method of using the 301 redirects.
This was my old method:
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index\.html
RewriteRule ^(.*)index.html$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.htm
RewriteRule ^(.*)index.htm$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.shtml
RewriteRule ^(.*)index.shtml$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.asp
RewriteRule ^(.*)index.asp$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.aspx
RewriteRule ^(.*)index.aspx$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.cfm
RewriteRule ^(.*)index.cfm$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.pl
RewriteRule ^(.*)index.pl$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/default\.asp
RewriteRule ^(.*)default.asp$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/default\.htm
RewriteRule ^(.*)default.htm$ http://www.bfxmedia.com/$1 [R=301] |
Once we figured out the issue, he provided me with this:
RewriteCond %{THE_REQUEST} !/links/ [NC]
RewriteCond %{THE_REQUEST} ^.*/(index|default)\.(s?html?|php|aspx?|cfm|pl)
RewriteRule ^(.*)(index|default)\.(s?html?|php|aspx?|cfm|pl)$ http://www.bfxmedia.com/$1 [R=301,L] |
He added the RewriteCond with the “links” directory and he condensed the line with all the file extensions down to one line. Now, I’ve got to change all my .htaccess files to this new streamlined version.
If you’re looking for a good (free) link trade script, you need to get LinkEX.

Using 301 redirects to avoid duplicate content
It has been brought to my attention that having a website that is accessible with and without the “www.” before the domain name is BAD!!! The reason for this is that search engines will consider this as two seperate sites that have duplicate content. The other problem is that an index.html file would also be seen as seperate page to a search engine. In order to understand this a little better, see the example below:
- http://bfxmedia.com
- http://bfxmedia.com/index.html
- http://www.bfxmedia.com
- http://www.bfxmedia.com/index.html
In the example above, all of those different URLs would have displayed the same page. In order to resolve this problem, use this Redirect Check SEO Tool. After you submit your website for testing, it will run through all the variations of the URL and give you the status code for each one.
To redirect all traffic from http://bfxmedia.com to http://www.bfxmedia.com, you would add the lines below to your .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.bfxmedia\.com
RewriteRule (.*) http://www.bfxmedia.com/$1 [R=301,L] |
Although, that didn’t work for me because of the way my subdomains are redirected. I had to use this instead:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^bfxmedia.com [NC]
RewriteRule ^(.*)$ http://www.bfxmedia.com/$1 [R=301] |
To redirect http://www.bfxmedia.com/index.html (and all other default page variations) to http://www.bfxmedia.com, you would add the lines below to your .htaccess file:
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index\.html
RewriteRule ^(.*)index.html$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.htm
RewriteRule ^(.*)index.htm$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.shtml
RewriteRule ^(.*)index.shtml$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.asp
RewriteRule ^(.*)index.asp$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.aspx
RewriteRule ^(.*)index.aspx$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.cfm
RewriteRule ^(.*)index.cfm$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/index\.pl
RewriteRule ^(.*)index.pl$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/default\.asp
RewriteRule ^(.*)default.asp$ http://www.bfxmedia.com/$1 [R=301]
RewriteCond %{THE_REQUEST} ^.*/default\.htm
RewriteRule ^(.*)default.htm$ http://www.bfxmedia.com/$1 [R=301] |
For the example site bfxmedia.com, I have corrected all the problems and now only one URL displays my “home” page. All the other variations are safely redirected.
Useful Links:
Redirect Check SEO Tool
SEO advice: url canonicalization
Canonical and Duplicate Versions of Content





Become one of our 