Can't get friendly urls to work in Joomla on an Apache server

I've been struggling with getting friendly urls to work on a Joomla website that's hosted on an Apache server:

http://virtuallitigationsupport.com/new/ 

The best I've been able to do is get urls that display like this:

http://virtuallitigationsupport.com/new/index.php/how-it-works

(which has the ugly "index.php" filename in the url)

As soon as I set "Use Apache mod_rewrite" to "Yes" in the Joomla Global Configuration, however, .. even though a url liek the following should work ...

 http://virtuallitigationsupport.com/new/how-it-works

.. I get 404 errors.

I currently have the following in my .htaccess file:

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^new/joomla\.html http://www.joomla.org/? [R=301,L]

That last line ( RewriteRule ) is used to verify that mod rewrite is enabled and working correctly on the server.  If you click on the following url, for example, you should be redirected to the joomla.org website:

http://virtuallitigationsupport.com/new/joomla.html

This is how I was able to verify that mod rewrite is in fact enabled on the server, and I used the following url for reference:

http://docs.joomla.org/Enabling_Search_Engine_Friendly_%28SEF%29_URLs

What I'm suspecting is that the fact that the entire site resides inside a subdirectory called "new" is creating a problem.  It's possible that I need to specify a"RewriteBase" value  -- but after experimenting with that for a bit (unsuccessfully) I finally gave up.

Does anyone here know what I might need to do get friendly urls working (without the "index.php" filename in the urls) with our current Joomla installation?

Thanks,
- Yvan  




egoselfaxisAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TonyRebaCommented:
Try using this extension

sh404SEF

sh404SEF rewrites Joomla URL to user-friendly format (SEF URL or URL rewriting): mysite.com/index.php?option=com_content&Itemid=69&id=34... becomes mysite.com/en/sh404SEF-and-url-rewriting/list-of-available-plugins.html).

http://extensions.joomla.org/extensions/site-management/sef/10134
0
egoselfaxisAuthor Commented:
Already tried 3 different plugins (including the one you referenced) .. and none of them worked.

- yg
0
austegaCommented:
Did you try " RewriteBase /new/ "?

I am not an expert on .htaccess but my working Joomla core SEF section looks like this:
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

Open in new window

0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

austegaCommented:
http://httpd.apache.org/docs/current/mod/mod_rewrite.html may help.

If you haven't already tried it you might want to try " RewriteBase /new ".

Also I think it is essential to have the RewriteBase between the RewriteEngine On directive and the RewriteCond directives.
0
Dean OBrienCommented:
I just tested on a clean install of Joomla 1.5 (works with new sub dir)

http://www.suredemo.co.uk/new/testing-search-engine-friendly-urls

Only steps: included the attached .htaccess file first, then enabled Apache mod rewrite and SEF in global.

Hope this help.

Easynow
##
# @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  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!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%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})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

#  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
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
egoselfaxisAuthor Commented:
easynow111 -- your updated htaccess file works wonderfully -- thank you so much!

http://virtuallitigationsupport.com/new/

One last question for you ..

When we eventually move this Joomla site out of that "new" subdirectory and into the root directory ---- will any further modifications be needed to the .htaccess file?  If so, .. what kinds of edits?

- yg
0
Dean OBrienCommented:
No probs, glad to help.

It should work fine, but if not just repost and will sort.

Easynow
0
egoselfaxisAuthor Commented:
Thanks!

- yg
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Joomla

From novice to tech pro — start learning today.