remove index.php from urls

Need help with the Administration of your Joomla! site? Pop your questions in here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
poppynap
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jul 30, 2009 5:50 am

Re: remove index.php from urls

Post by poppynap » Sat Dec 31, 2011 9:43 pm

at the end of your .htaccess page you will see this:

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# 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 root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|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 .* index.php [L]
#
########## End - Joomla! core SEF Section



all you have to do is remove the # from in from of the # RewriteBase / and it should work, so it the end of your .htaccess will look like this now. Please notice the change.


# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

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 root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|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 .* index.php [L]
#
########## End - Joomla! core SEF Section

danbush
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Jan 15, 2013 8:39 pm

Re: remove index.php from urls

Post by danbush » Wed Jan 16, 2013 3:49 am

I know this is an old post, but I'm at my wits end trying to get rid of the index.php in my urls.

If I go to "http://184.173.204.66/~bcm/index.php/ohio/ravenswood" it works just fine. If I remove the index.php part of the url, it doesn't work. I'm trying to duplicate a DNN site on Joomla

My Joomla configuration:
Search Engine Friendly URLs: YES
Use URL rewriting: YES

My .htaccess file:
##
# @package Joomla
# @copyright Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#

RewriteCond %{QUERY_STRING} ^$
RewriteRule ^OhioProperties/RavenswoodStow\.aspx$ http://184.173.204.66/~bcm/index.php/ohio/ravenswood? [R=301,NE,NC,L]

## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

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 .* index.php [L]

## added by Dan - begin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule .* index.php/$0 [PT,L]
RewriteRule .* index.php [L]
## added by Dan - end
#
## End - Joomla! core SEF Section.

MalcolmPur
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Mar 14, 2013 12:25 pm

Re: remove index.php from urls

Post by MalcolmPur » Thu Mar 14, 2013 1:19 pm

Hi, as a new user to joomla, which currently looks brilliant I have possibly the same problem as stated.
let me explain.
i have an email form, during development of the form using the editor pressing the submit button produces a connection to my contact.php file and tells me it is not filled in correctly.
as a user i open the form and do not fill in the details but press the submit button and get error page not found 404.
the url shows indetel.co.uk/index.php/contact.php
without the index.php i assume it will work.
i looked into the .htaccess file and mine is empty.
can i just add the rewrite into the file to fix the fault.

cheers
Malcolm

te_libera
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue Oct 11, 2011 10:21 pm

Re: remove index.php from urls

Post by te_libera » Wed May 15, 2013 11:18 pm

Here is one solution that my hosting give me:

One line added to the .httaccces

after: RewriteEngine On
been writting: RewriteBase /

RewriteEngine On
RewriteBase /

suskun62
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Dec 14, 2011 9:48 am
Contact:

Re: remove index.php from urls

Post by suskun62 » Sun Mar 23, 2014 11:50 am

te_libera wrote:Here is one solution that my hosting give me:

One line added to the .httaccces

after: RewriteEngine On hayvanlar alemi
been writting: RewriteBase /

RewriteEngine On
RewriteBase /

İ'am still using joomla 1.0 version and i have the same problem, i followed your steps but i' could'nt manage urls, i think there is a .htaccess problem


Locked

Return to “Administration - 1.0.x”