Skip to main content

Redirecting index.php to root in Joomla 1.5 wiht htaccess


Its very important that the homepage of the website is accessible through one URL only. For example, a typical joomla site would be accessible by domainname.com, www.domainname.com, domainname.com/index.php and www.domainname.com/index.php. If you are using frontpage component on the homepage, you may have an additional URL for homepage. This way, the power of backlinks and google PR is distributed across several URLs. This can be easily taken care of by using the following code in .htaccess file.


For redirecting /index.php to www.domainname.com:

Options +FollowSymLinks
DirectoryIndex index.php

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.domainname.com/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


For redirecting domainname.com to www.domainname.com:

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domainname.com [nc]
rewriterule ^(.*)$ http://www.domainname.com/$1 [r=301,nc]



Once you have done this, you can check the redirection using a fantastic redirect check tool I can across. This tool will provide all possible URLs for your homepage along with the response code. The response code of 200 which is an OK response should be returned by just one URL.

Comments

Popular posts from this blog

Blogged: චන්නට මොකද උනේ ? චන්න ඇයි මෙහෙම කරගත්තෙ ?

ඊ.බී. චන්නව මා හඳනාගන්නේ 1994 වසරේදීයි එවකට මම පාසල් ශිෂ්‍යයෙක්, සෑම පාසල් ක්‍රීඩකයෙකුම සිහින මැව්වෙ, චන්න වගේ පාපන්දු ක්‍රීඩකයෙකු වෙන්න.  ඔහු මුලින්ම ජාතික තලයට පිවිසෙන්නේ, වයස 18 න් පහළ ශ්‍රී ලංකා කණ්ඩායම නියෝජනය කරමින් ඉන්දියාවේ පැවැති තරගාවලියකට සහභාගීවෙමින්, ඔහු ගාල්ල යූත් ගාල්ල යුනයිටඩ් ක්‍රීඩා සමාජ දෙකම විටින් විට නියෝජනය කල අතරම, ඔල්ඩ් ජෝස් ( මරදාන ආදි ශාන්ත ජෝසප් ) කණ්ඩායම නියෝජනය කලා. පාසල් සමයේම දක්ෂතා ගොන්නක් එක්ක පීදුනු මෙම ක්‍රීඩකයා ප්‍රධාන පෙලේ තරග වලට පිවිසුනේ   , පෙටා යුනයිටඩ් හා වික්ටර් ක්‍රීඩා සමාජ වලින්.  ජාතික කණ්ඩායම වසර 15 කට අධික කාලයක් නියෝජනය කරපු චන්න මෙරට ඇති බොහෝ ක්‍රීඩා සමාජ වල ප්‍රධාන සාමාජිකයෙක් වුණා. ඒ වගේම මාලදිවයින, ඉන්දියාව, බංග්ලාදේශය වගේ රටවලත් ක්‍රීඩා සමාජ තරගවලට ක්‍රීඩා කරපු චන්න දැන් ඉන්නේ ගාල්ල නගර සභාවෙ සුලු සේවකයෙකු විදියට ලු..  දැනටත් කලුතර බ්ලූස්ටාර් කණ්ඩායමේ සාමාජිකයෙකු වන චන්නට මෙහෙම වුනේ ඇයි ?  ඔහු  අතීතයෙන්, වර්තමානයට හෝ අනාගතයට අයෝජනයක් කර ගෙන නැත. ඉහළ සාමාජ තත්වයක් සකසා ගැනීමේ හැකියාව මෙන්ම අත්දැකීම්...

Configuring Your MX Records: Other domain hosts Google Apps

These instructions are provided as a general guide for changing MX records. Sign in to your hosting account, and go to the MX record maintenance page.   Who is my domain host? MX records may be located in   DNS Management ,   Mail Server Configuration , or   Name Server Management . You may have to enable advanced settings to edit your MX records. Delete all existing MX entries. By default, MX records may already be present. Enter the following MX records. You may not be able to enter the priority value exactly as it appears in the table below -- if you can, make sure each record follows the indicated order. If you aren't able to assign priorities, you should only enter   aspmx.l.google.com. . Set any TTL values to 1 Hour (value=3600). Priority Mail Server 1 ASPMX.L.GOOGLE.COM. 5 ALT1.ASPMX.L.GOOGLE.COM. 5 ALT2.ASPMX.L.GOOGLE.COM. 10 ASPMX2.GOOGLEMAIL.COM. 10 ASPMX3.GOOGLEMAIL.COM. Note : ASPMX.L.GOOGLE.COM is the top priority mail server. Don't...

Received an amazing birthday gift - It's you & your kind wishes

Another year has passed, another digit added to my age, time sure does fly. I would like to thank each and every one of you for your lovely wishes, and in return would like to wish you all the success and happiness throughout the future. Realized the power and extent of social networking when it came to my birthday. I don’t think I have ever received as many wishes. Hello my friends, just a quick note tonight to say thank you for all your Wishes. It filled my heart with joy to read all of your kind words. I had a wonderful day and I am still enjoying, Thanks a lot, you all are so special to me and your wishes too. I can’t believe I have to wait another year to hear such sweet things again. Once again i thank all of you for this compliment and the wonderful wishes, I will never ever forget this. I tried to attend & reply each and every wish faithfully, and also urge forgiveness if missed by any mistake. Facebook Wishes Twitter Wishes ...............