SEF & .htaccess - How I got mine to work on a hosted server
Posted: Sun Mar 26, 2006 9:41 pm
Having poored over this site for 2 days and trying multiple solutions of which NONE worked i was starting to pull my hair out i ket on getting 500 internal server errors again and again!!!
I found a solution to my problem 5 minutes ago, that as far as i know no one has posted on here before so I thought I'd share it.
My hosting company was pretty much refusing to AllowOverride All, this was the solution that every other post was saying i needed but when i spoke to the host company 1and1.co.uk, they just kept repeating themselves saying that i could do it all myself.
Another day of study and i found this on http://httpd.apache.org/docs/2.0/mod/co ... owoverride
[quote="apache"]
Example:
AllowOverride AuthConfig Indexes
In the example above all directives that are neither in the group AuthConfig nor Indexes cause an internal server error.[/quote]
It all made perfect sense! your host allows certain commands that let you do what you need. So all i needed to do was find the commands in the .htaccess file that it didn't like and # them (also called commenting i think)
My host documentation said this...
[QUOTE=1and1]
The following list is a selection of commands which can be used in a ".htaccess" file:
Command Description
ErrorDocument Define your own custome error pages
AddType Assign a MIME-Type to a file ending
RewriteEngine Activate mod_rewrite module
Allow/Deny Host or IP based access control
FilesMatch File based access control
AuthType Basic password check
Redirect Redirection to another page or site
Options (de)activate index, symbolic links, etc.[/QUOTE]
This meant that i had to get rid of various commands that i'd put in my .htaccess file while i tried to make it work...
I had to remove (ie #)
mod_rewrite in use
AllowOveride (which someone else had advised to put in)
Once i ensured that my list of commands matched what the host would let me do this left me with this whole file
[Quote=Bri's .htaccess]
##
# @version $Id: htaccess.txt 1570 2005-12-29 05:53:33Z eddieajau $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##
Options +FollowSymLinks
#
# mod_rewrite in use
#
RewriteEngine On
##
## NOTE!
## When using multiple Joomla sites or other web applications in sub-folders,
## you must explicitly turn the RewriteEngine off or use the settings
## recommended for the application
##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update YourJoomlaDirectory (just / for root)
RewriteBase /
#
# Rules
#
RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
[/Quote]
And hey presto i now have a basic SEF site http://www.aquanauts.co.uk
now to try out SEF Advanced
Hope this helps someone
Bri
EDIT forgot to mention i had to change a bit in configuration.php in the root
$mosConfig_sef = '0';
had to be changed to
$mosConfig_sef = '1';
also the htaccess.txt file had to be saved in the root as .htaccess
I found a solution to my problem 5 minutes ago, that as far as i know no one has posted on here before so I thought I'd share it.
My hosting company was pretty much refusing to AllowOverride All, this was the solution that every other post was saying i needed but when i spoke to the host company 1and1.co.uk, they just kept repeating themselves saying that i could do it all myself.
Another day of study and i found this on http://httpd.apache.org/docs/2.0/mod/co ... owoverride
[quote="apache"]
Example:
AllowOverride AuthConfig Indexes
In the example above all directives that are neither in the group AuthConfig nor Indexes cause an internal server error.[/quote]
It all made perfect sense! your host allows certain commands that let you do what you need. So all i needed to do was find the commands in the .htaccess file that it didn't like and # them (also called commenting i think)
My host documentation said this...
[QUOTE=1and1]
The following list is a selection of commands which can be used in a ".htaccess" file:
Command Description
ErrorDocument Define your own custome error pages
AddType Assign a MIME-Type to a file ending
RewriteEngine Activate mod_rewrite module
Allow/Deny Host or IP based access control
FilesMatch File based access control
AuthType Basic password check
Redirect Redirection to another page or site
Options (de)activate index, symbolic links, etc.[/QUOTE]
This meant that i had to get rid of various commands that i'd put in my .htaccess file while i tried to make it work...
I had to remove (ie #)
mod_rewrite in use
AllowOveride (which someone else had advised to put in)
Once i ensured that my list of commands matched what the host would let me do this left me with this whole file
[Quote=Bri's .htaccess]
##
# @version $Id: htaccess.txt 1570 2005-12-29 05:53:33Z eddieajau $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##
Options +FollowSymLinks
#
# mod_rewrite in use
#
RewriteEngine On
##
## NOTE!
## When using multiple Joomla sites or other web applications in sub-folders,
## you must explicitly turn the RewriteEngine off or use the settings
## recommended for the application
##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update YourJoomlaDirectory (just / for root)
RewriteBase /
#
# Rules
#
RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
[/Quote]
And hey presto i now have a basic SEF site http://www.aquanauts.co.uk
now to try out SEF Advanced
Hope this helps someone
Bri
EDIT forgot to mention i had to change a bit in configuration.php in the root
$mosConfig_sef = '0';
had to be changed to
$mosConfig_sef = '1';
also the htaccess.txt file had to be saved in the root as .htaccess