Saturday, July 9, 2011

Joomla 1.6 & Joomla 1.5 Remove index.php from the URL

This works!!!! If not mail me harshal82@gmail.com

Joomla 1.6 .
My Joomla is installed /var/www/joomla


1. Go to Site->Global Configuration and enable Search Firendly URL and use URL rewriting. Save.

2. Go to /var/www/joomla (myroot)  and rename htaccess.txt to .htaccess.
3. Enable apache mod rewrite  from terminal sudo a2enmod rewrite
4. Open nano .htaccess under /var/www/joomla

and below should be the setting

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* /joomla/index.php/$1 [L]
#
## End - Joomla! core SEF Section.



The line in red redirects the page to relavent page without changing the url.

http://yoursite/joomla/test should deliver the page.