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

ජාතික ගීය හෝ ජාතික ධජය, අන්තවාදය පෙන්වන ආභරණයන් නොවේ..

ජාතික ගීය හෝ ජාතික ධජය, ජාතික ධජයේ වර්ණයන් යනු තොපේ ජාතිය හෝ ධර්මය පෙන්වන ආභරණයන් නොවේ.. එය ජාත්‍යාලය, දේශාභිමානය‍‍‍ හා දේශයේ පෞඪත්වය පෙන්වන ජාතියේ අනන්‍යතාව යයි.  ජාතිය යනු ශ්‍රී ලාංකික ජාතියයි.  ලංකාවේ සම"හරක්" වැනි පටු අරමුණු සහිත වූවන් ඉන්දියාව වැනි රටක රජවී සිටියානම් ඔවුන්ගේ ජාතික ගීය භාශා 1000 කින් පමණ remix වන්නට ඉඩ තිබුණි.  සරල උදාහරණයක් - ඉන්දියාව හා දකුණු අප්‍රිකාව අතර 20-20 ලෝක කුසලානයේ තරගයෙන් පසුව, ඉන්දීය ජාතික කොඩියේ වර්ණයන් ගෙන් යුතුවූ සමරු ලෙහෙන්සුවක් මා දෝනී වෙත ලබාදී ඔහුගෙන් සමරු සටහනක් ඉල්ලූ අවස්තාවේ ඔහු ඔහුගේ කැප් එක මට ලබාදී පැවසුවේ. කෙදිනකවත් ඉන්දියානුවෙකු තම ජාතික කොඩියට හෝ තම රටට අගෞරව නොකරන බවයි.  (මට දෝනී පේන්න බැරි චරිතයකි)  ඔවුන් තුළ ඇති දේශාභිමානය‍‍‍..... ඔවුන්ගේ ජාතික අනන්‍යතාවය මතු පරපුර වෙනුවෙන් ඉතිරිකොට ඇත.

Blogged: බයියන් - ටොයියන් - කබ්බන් හා රූකඩ අතර සිරවුන තරුණ චන්ද

එවකට නිදහස් පක්ෂය ලෙස පිරිසක් හිටපු ජනපති දිනවීමට දිවිහිමියෙන් කටයුතු කලේය. නමුත් අවසානයේ ඔහුට පරාජය වීමට සිදුවිය. නිදහස් පක්ෂයේම වුවත් එහි විරුද්ධ පක්ෂ හා කඳුවුරු බැඳි එවකට සෞඛ්‍ය ඇමතිවරයා ජනපති විය. පරාජිත පාක්ෂිකයන් හා ජයග්‍රාහී පාක්ෂිකයන් කාකොටා ගැනීම ආරම්භ කලේය. පරාජිත පාක්ෂිකයන් තම පරාජිත හැඟීම පිට කලේ, ‍ජාතිවාදය, යුද මානසිකත්වය, හා පුද්ගල චරිත පදනම් කරගනිමිනි. ඒ ඔවුන් එම තත්වයට පත්කල ජනතාවගේ නි‍යෝජිතයන් කියාගන්නා පිරිසක් හේතුවෙනි. ජයග්‍රාහී පාක්ෂිකයන්, සතුට භුක්තිවිඳීම ආරම්භ කලේ ජයග්‍රහණය සැමරීම පසෙකලා පරාජිතයන්ගේ හැඟීම් වලට පහර දෙමිනි. එයද මහජන නියෝජිතයන් යැයි කියාගන්නා පිරිසකගේ අවශ්‍යතා පිරිමැසීමක් විනා අන් කිසිවක් නොවේ. පරාජිතයන්, නැවත නැගී සිටීමට සියලු උත්සාහයන් දැරීම ‍ස්වාභාවිකය. ඒ අනුව නිදහස් පක්ෂය කටයුතු කරනවාද යන්න සැක උපදවයි. ඔවුන් එය පසෙකලා ජයග්‍රාහී පක්ෂයේ ඕනෑ එපාකම් ඉටුකිරීමට සෘජුව හා වක්‍රව වපසරිය සකසමින් සිටී. නැවත බලය තහවුරු කරගැනීමට ඇතැම් බලවේග පෙළගැසෙද්දී හිටපු ජනපතිවරයා තම ලේ දහඩිය වැයකල ප්‍රධාන පක්ෂය ඊට සහභාගීවීම ප්‍රසිද්ධියේ ප්‍රතික්ෂේප කලේය. එසේ...

Blast Cast for RSS Widgest to web sites

News widget or news ticker to add the content to your website or blog. The widgets are highly customizable and can fit seamlessly into your website. Widget Maker for Websites If you have one or more RSS or Atom feeds, you can create a custom widget designer for your website and allow your visitors to create widgets for their websites using your feeds. Because the feed links in the created widgets point to your website, this can help your website or blog gain more traffic and generate more reader interest. RSS Widgets and more... • Create a News Widget • Create a News Ticker • Create a Feed-Landing Page • Create a Feed Widget • Combine, Filter, Sort Feeds • Convert Feed Format • Get Feed in JSON Form • Tap into the Feed API