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.

Comments
Leave a Reply







