UnitedForums - UK Web Hosting Forum UnitedHosting Community Hosting Forums
Network and Server StatusCustomer SupportUK Web Hosting
UnitedHostingUnitedHosting Sitemap UK Hosting ForumUK Web HostingWeb Hosting ForumsUK Reseller HostingWeb Host CommunityUK Managed Dedicated ServersHosting Help and SupportUK Domain Name Registration

Go Back   UnitedForums.co.uk > UnitedHosting Community > Website Applications

Reply
 
Thread Tools Rate Thread Display Modes
Old 20th August 2008, 04:47 PM   #1 (permalink)
jappleton
Registered User
 
Join Date: Jul 2007
Location: London
Posts: 16
Joomla 1.5.6 and mod rewrite using htaccess

Hi
I'm building a new Joomla site using version 1.5.6 and have SEF URLS working nicely with SHS404SEF but I like the thought of removing the /index.php so am trying to get it working using mod_rewrite

I've added the htaccess file below to my site (which by the way lives in a subdomain if that matters?) but am getting internal server errors when i click a link.

Can anyone tell me if the htaccess file below is incorrect?

Thanks
JOnathan

The server error reads..

"mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary."

The Htaccess file reads

SecFilterEngine Off
SecFilterScanPOST Off

##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license The GNU General Public License - GNU Project - Free Software Foundation (FSF) 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!
#
# Block out any script trying to set a mosConfig value through the URL
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


########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section
jappleton is offline   Reply With Quote
Old 25th August 2008, 07:34 AM   #2 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Posts: 2,099
I have the same revision number of that htaccess.txt file (10492), but without the final section titled "3rd Party SEF Section" where did you get that code from?

From what I can see, I don't see any reason why you couldn't just delete that section and uncomment the "Jooomla! core SEF Section"

Removing index.php can be setup in "Global Configuration" under the option "Use Apache mod_rewrite"
__________________
Freelance PHP Programmer
__________________
Simon is offline   Reply With Quote
Old 25th August 2008, 12:13 PM   #3 (permalink)
jappleton
Registered User
 
Join Date: Jul 2007
Location: London
Posts: 16
Hi Simon
Thanks for the reply
Support helped me out as my site was in a subdomain outside of www so once it was moved in to there the mod-rewrite worked.
Ive tried SHS404SEF but seems to need alot more tweaking to get all joomla and coms working so for now iv left that and stuck with native Joomla SEF.
Everyone raves about SHS404SEF but my deadline is tight but am sure its a great com once you learn in.
Thanks
Jonathan
jappleton is offline   Reply With Quote
Old 3rd July 2009, 04:11 PM   #4 (permalink)
parca
Registered User
 
Join Date: Apr 2009
Posts: 2
SEF for Joomla 1.5.11

For Joomla 1.5.11 you just need to use the standard Joomla htaccess file. Turn on Search Engine Friendly URLs and turn on Use Apache mod_rewrite in the Global Configuration. BUT make sure you have set your Joomla config file to this for your live site:

var $live_site = '/';

and for your preview URL:

var $live_site = '/~admin[n]/'; or var $live_site = '/~domainname/';
parca is offline   Reply With Quote
Old 3rd July 2009, 04:26 PM   #5 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Posts: 2,099
parca: good to see you know your Joomla, but you missed the latest update!

Joomla is now 1.5.12 - If you use image upload you might also want to check the following patch : JoomlaCode > Projects > Joomla! > Tracker > Joomla! 1.5.x Bug Tracker > Edit Tracker Item

Simon
__________________
Freelance PHP Programmer
__________________
Simon is offline   Reply With Quote
Old 3rd July 2009, 04:32 PM   #6 (permalink)
parca
Registered User
 
Join Date: Apr 2009
Posts: 2
1.5.11 / 12

Thanks for reminding me. I had seen it just haven't got to apply it yet, must do it.
parca is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 06:05 PM.

UK Web Hosting  |  UK Reseller Hosting  |  UK Dedicated Servers UnitedHosting  |  UnitedSupport  |  SEO by vBSEO 3.0.0
Copyright © 1998-2009 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309