Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 01-04-2008, 07:32 PM
eric281 eric281 is offline
Hatchling Croc
 
Join Date: Jan 2008
Posts: 3
Default Joomla and mod_rewrite not working?

I installed Joomla 1.5 and couldn't get this to work, so I deleted it and installed Joomla 1.0.x through the Fantastico installer. Problem is, anytime I change htaccess.txt to .htaccess so that I can turn on the SEO URLs I get server errors and can't reach the site. Live chat told me that HG does support mod_rewrite, but from looking at my log files, it doesn't look like it. Any ideas?
Reply With Quote
  #2  
Old 01-04-2008, 07:44 PM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: Joomla and mod_rewrite not working?

What error do you get? internal server error?
Reply With Quote
  #3  
Old 01-04-2008, 07:45 PM
eric281 eric281 is offline
Hatchling Croc
 
Join Date: Jan 2008
Posts: 3
Default Re: Joomla and mod_rewrite not working?

Yes. I get a 500.
Reply With Quote
  #4  
Old 01-04-2008, 08:10 PM
eric281 eric281 is offline
Hatchling Croc
 
Join Date: Jan 2008
Posts: 3
Default Re: Joomla and mod_rewrite not working?

This is what my .htaccess looks like once I take the comments out. I've tried changing the rewrite base line by uncommenting it and point it to /joomla/ which is my current install directory but it makes no difference.

Quote:
Options +FollowSymLinks
RewriteEngine On
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
If any of that is invalid, let me know and I"ll try to fix it, but it is exactly what comes with Joomla.

Here is one of the errors I see in the error log:
Quote:
[Fri Jan 4 19:24:12 2008] [alert] [client 98.199.17.128] /home/insider/public_html/joomla/.htaccess: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration
Seems like this is where my problem is. What next?
Reply With Quote
  #5  
Old 02-24-2008, 02:16 AM
jono jono is offline
Hatchling Croc
 
Join Date: Jan 2007
Posts: 21
Default Re: Joomla and mod_rewrite not working?

No here is the deal

1. if your using 3rd party seo you need to go in and comment out the lines in your .htaccess and uncomment a few others using #

2. make sure to rename htaccess.txt to .htaccess

Like this

########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteRule ^(content/|component/) index.php
#
########## 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
Reply With Quote
  #6  
Old 02-24-2008, 07:07 AM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,921
Default Re: Joomla and mod_rewrite not working?

Yes, typically the components come with some lines to put in your .htaccess

I always have to comment out anything with follow symlinks or it causes 500 errors
Reply With Quote
  #7  
Old 02-24-2008, 03:16 PM
ldearing's Avatar
ldearing ldearing is offline
Royal Croc
 
Join Date: Dec 2006
Location: Atlanta, Ga.
Posts: 613
Default Re: Joomla and mod_rewrite not working?

are you using sh404sef?... make sure your set to "with .htaccess" in the admin config area... and use the htaccess lines provided by eric above and give it a shot
__________________
Cheers!!
Larry D.
Reply With Quote
  #8  
Old 02-25-2008, 07:34 PM
dave g dave g is offline
Swamp Croc
 
Join Date: Mar 2005
Location: Ellington a cow town in Connecticut
Posts: 359
Default Re: Joomla and mod_rewrite not working?

Good Day

From what I see you may also need to change:
Options +FollowSymLinks
to
Options ExecCGI +FollowSymLinks
or comment out the line.

Dave G

Last edited by dave g; 02-25-2008 at 07:37 PM.
Reply With Quote
  #9  
Old 02-04-2009, 11:24 PM
mcmattp mcmattp is offline
Hatchling Croc
 
Join Date: Feb 2009
Posts: 7
Default Re: Joomla and mod_rewrite not working?

I have been working on these problem since I started using Hostgator. It has riddled me and now that I am REALLY wanting to get it to work, I am thinking of leaving hostgator over it.

I have contacted hostgator about this and they replied that it has nothing to do with them, and that I need to dig deeper into joomla and my .htaccess file.

I have commented out all of the lines like the above post by Jono and I have also tried the adjustment that Dave_g posted. I also did his alternate solution which was to comment out the line.

Every single one of these options leaves me with a 404 error. I was certain to clear out my cache and offline website data before each attempt of adjusting my .htaccess file.

Is there ANYONE out there that has enabled sh404sef with Joomla and Hostgator? This is starting to go from a hard project, to just plain ridiculous! What the heck hostgator!?
Reply With Quote
  #10  
Old 02-05-2009, 12:02 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,040
Default Re: Joomla and mod_rewrite not working?

Quote:
Originally Posted by mcmattp View Post
I have contacted hostgator about this and they replied that it has nothing to do with them, and that I need to dig deeper into joomla and my .htaccess file.
....
What the heck hostgator!?
It has nothing to do with Hostgator. It is up to you to install / configure you own scripts. They sell you the hosting space, you provide the rest.

Try resources like http://doc.extensions.siliana.com/in...itle=Main_Page

They will be able to advise you far better than HG.
__________________
- David
Reply With Quote
  #11  
Old 02-05-2009, 12:13 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,040
Default Re: Joomla and mod_rewrite not working?

Further to my previous post, here is another great resource.

http://www.a3webtech.com/index.php/install-sh404.html
__________________
- David
Reply With Quote
  #12  
Old 02-05-2009, 04:06 AM
mcmattp mcmattp is offline
Hatchling Croc
 
Join Date: Feb 2009
Posts: 7
Default Re: Joomla and mod_rewrite not working?

Well I have tried both of the resources you linked and I have gone through just about every variation of my .htaccess I have searched for months with something that makes sense.

In that time I have not come into contact with ONE person that uses hostgator and can get this configured properly. Not to mention there are hundreds of forum posts across the internet if you google it, with people who have the same problem as me.

I am sure there is a large chance that they also are having issues configuring it and that hostgator still isn't to blame, but it seems a little strange?

Any more assistance would be of great help. I am so tired of this.
Reply With Quote
  #13  
Old 02-05-2009, 07:38 AM
ldearing's Avatar
ldearing ldearing is offline
Royal Croc
 
Join Date: Dec 2006
Location: Atlanta, Ga.
Posts: 613
Default Re: Joomla and mod_rewrite not working?

i am using sh404sef on joomla 1.0 AND 1.5 successfully on several sites here at hostgator. its been a year since i looked at this post. the additional lines to include in .htaccess suggested above should work. also if you are using /joomla as your install directory, you will have to "rewrite base to /joomla. again, make sure in your joomla install that sh404sef is indeed enabled.... it is not by default. also make sure it is set to "with .htaccess"... by default it is not. lastly, make sure the mod is published to the last mod position.
__________________
Cheers!!
Larry D.
Reply With Quote
  #14  
Old 02-05-2009, 03:40 PM
mcmattp mcmattp is offline
Hatchling Croc
 
Join Date: Feb 2009
Posts: 7
Default Re: Joomla and mod_rewrite not working?

Quote:
Originally Posted by ldearing View Post
i am using sh404sef on joomla 1.0 AND 1.5 successfully on several sites here at hostgator. its been a year since i looked at this post. the additional lines to include in .htaccess suggested above should work. also if you are using /joomla as your install directory, you will have to "rewrite base to /joomla. again, make sure in your joomla install that sh404sef is indeed enabled.... it is not by default. also make sure it is set to "with .htaccess"... by default it is not. lastly, make sure the mod is published to the last mod position.

Thanks for this... I apologize for my newbness, but I am having some issues still. More info:

The above lines I tried to copy and paste, it didn't work. I also tried commenting out the lines on my existing setup. sh404sef is installed and working, it's just that it won't work with .htaccess. I can get it to work with the experimental mode but I have the /index.php? in the url. I do not have joomla installed into a directory named /joomla I have been installing joomla outside of fantastico and using Rocket Themes club templates.

As soon as I attempt to us the file, it seems no feasible variation will work.
Quote:
lastly, make sure the mod is published to the last mod position.
I am not sure what you mean. No idea actually.



Thanks for the help. Can someone just copy and paste a working .htaccess file???
Reply With Quote
  #15  
Old 02-05-2009, 05:14 PM
MegaHostUK MegaHostUK is offline
Hatchling Croc
 
Join Date: Feb 2008
Location: UK
Posts: 16
Default Re: Joomla and mod_rewrite not working?

I have many installations of Joomla 1.5 and sh404sef, are you only getting the error on the front-end if so that means that the configuration is actually mis-configured?

I would recommend if it’s a new install just start over, re-install 1.5 then install sh404sef enable it re-name .htaccess, change setting in sh404sef to use .htaccess and away you go. I have never had to edit the .htaccess file to get this to work, maybe that’s just luck.

If all else fails - PM ME and ill install it for you.

Last edited by MegaHostUK; 02-05-2009 at 05:16 PM. Reason: Noobism2
Reply With Quote
  #16  
Old 02-05-2009, 05:38 PM
BrianH's Avatar
BrianH BrianH is offline
Junior Croc
 
Join Date: May 2006
Posts: 111
Default Re: Joomla and mod_rewrite not working?

For what it's worth, I'm running Joomla 1.5.9 on several domains on HG servers and I don't have any problems with short SEF urls. I don't use sh404sef or any other 3rd party seo module.

All you should have to do is rename htaccess.txt to .htaccess, and then go to global configuration > Site and select 'yes' for both 'Search Engine Friendly URLs' and 'Use Apache mod_rewrite'.

Here is the standard joomla .htaccess code that should work for you:

Quote:
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

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]
Hope you can get it sorted out.
Reply With Quote
  #17  
Old 02-05-2009, 05:52 PM
ldearing's Avatar
ldearing ldearing is offline
Royal Croc
 
Join Date: Dec 2006
Location: Atlanta, Ga.
Posts: 613
Default Re: Joomla and mod_rewrite not working?

Sorry mcmattp - got my posts mixed up. yes if you installed to / then you dont need to rewrite base.

Yes you can cut and past a working .htaccess file... the safest way is probably through cpanel file manager.

a couple global settings to check as well... in 1.5 Global config panel, Site Tab, make sure SEO Settings are set to use Apache mod_rewrite YES,

Under Components menu - sf404SEF - click on sh404SEF Configuration...main tab, back sure enabled "yes" - on advanced tab Rewritting mode "with .htaccess (mod_rewrite).

publishing to last postion... sh404SEF docs say it should be published to the last loading "position" but this seems to have changed in the 1.5 version. check the following though:

under Extensions menu, go to plugin manager, find System - sh404SEF plugin and make sure it is enabled (this is a deal breaker right here) with green check. if it is not, enable it and test.... if still not working go back here , enter System - sf404SEF plug in and check the order. there should be an "order" pull down. tell us what is is currently and what is still beneath that position as choices.

- i think we can get you through this, i agree with above, something is misconfigured.

[edit: some duplication of BrianH's great addition above, we were working on it at the same time!]
__________________
Cheers!!
Larry D.
Reply With Quote
  #18  
Old 02-06-2009, 11:52 AM
mcmattp mcmattp is offline
Hatchling Croc
 
Join Date: Feb 2009
Posts: 7
Default Re: Joomla and mod_rewrite not working?

Ok so the world is testing my patience. I just wrote a few pages after logging in and then it said I wasn't logged in and erased my reply. Yay!

So I have done all of the above three times over, and I did this the last time I sought help on this and NOTHING. I will explain in detail:

I enabled SEF urls in global as well as use mod_rewrite. I have used the original .htaccess.txt and renamed it to .htaccess

I went into plugin manager and enabled sh404SEF and set it to the last position. It was set to the second to last position. I was also sure to set to use mod_rewrite in the advanced options of sh404SEF. When I view any other page but the main homepage I get a 404 page not found error.

Note

I have read that if you can not get SEF url's working with Joomla core than you should just disable sh404SEF and figure out what is wrong from there. This is what I have been doing the last couple of days with no luck. I have also made sure that this site is a new install and an extremely basic site with nothing too special going on... Still nothing. Not even a hint as to what could be wrong.

So if others have gotten Joomla core to work with SEF urls not changing their .htaccess files or "commenting" out the lines as others have mentioned, then I am again, back at square one with no idea as to what could be wrong.

I suppose I'll keep searching for a seemingly futile resolution.


Matt

p.s. thanks
Reply With Quote
  #19  
Old 02-06-2009, 12:03 PM
mcmattp mcmattp is offline
Hatchling Croc
 
Join Date: Feb 2009
Posts: 7
Default Re: Joomla and mod_rewrite not working?

Ok So I realized I should have done this a while ago. Here is exactly what my .htaccess file is (and by the way, I am putting it in the sites folder, not in the general servers folder as well. I have many sites through the same hosting account and I am putting it in the specific joomla install folder)


################################################## ###
# 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


Thanks again.

Matt
Reply With Quote
  #20  
Old 02-06-2009, 12:16 PM
mcmattp mcmattp is offline
Hatchling Croc
 
Join Date: Feb 2009
Posts: 7
Default Re: Joomla and mod_rewrite not working?

I just copy and pasted Brian H's code and the exact same 404 error on everything but the hompage. yay!

Matt
Reply With Quote
  #21  
Old 02-06-2009, 01:39 PM
kompreszor's Avatar
kompreszor kompreszor is offline
Swamp Croc
 
Join Date: Jun 2007
Location: Pennsylvania, USA
Posts: 330
Default Re: Joomla and mod_rewrite not working?

Quote:
Originally Posted by mcmattp View Post
Ok So I realized I should have done this a while ago. Here is exactly what my .htaccess file is (and by the way, I am putting it in the sites folder, not in the general servers folder as well. I have many sites through the same hosting account and I am putting it in the specific joomla install folder)
If I understand you correctly, the joomla install in NOT in the public_html directory? If this is true, you need to uncomment RewriteBase and change it to reflect the path to the directory joomla is installed in.

For example, if joomla is installed in the directory "public_html/joomla"
Change:
Code:
#RewriteBase /
To:
Code:
RewriteBase /joomla
I've had sh404SEF working perfectly here at HG. You have to read the documentation carefully if you're new to joomla, it can be a little hard to understand. First you must have the Joomla 1.5 Core SEF working correctly before you can enable sh404SEF. sh404SEF works in conjunction with the Joomla Core SEF to rewrite the url's. So if the core files are not working nothing will work.

It's best to start with just the core SEF that comes with joomla and enable the options one at a time while checking the site to make sure everything is working. Once all the core SEF settings are working in the Joomla Global Configuration you can go into sh404SEf Control Panel/Configuration and set it to enabled. You must leave the Joomla Core SEF turned on for sh404SEF to work.

Other things, turn off and cache settings in joomla and you web browser. Check the permission of you .htacces file, 644?
__________________
“There is a principle which is a bar against all information, which is proof against all arguments and which cannot fail to keep a man in everlasting ignorance—that principle is contempt prior to investigation.”
—Herbert Spencer
Reply With Quote
  #22  
Old 02-06-2009, 01:41 PM
BrianH's Avatar
BrianH BrianH is offline
Junior Croc
 
Join Date: May 2006
Posts: 111
Default Re: Joomla and mod_rewrite not working?

Do you have any characters other than letters in your article names? I had an article with a period in it that was causing a 404 error.
Reply With Quote
  #23  
Old 02-08-2009, 11:53 PM
mcmattp mcmattp is offline
Hatchling Croc
 
Join Date: Feb 2009
Posts: 7
Default Re: Joomla and mod_rewrite not working?

I finally got it. I wasn't any of the above adjustments or commenting it out. I was saving or renaming the original file incorrectly, as well as a few config steps away from ever getting.

It has nothing to do with hostgator. I am sorry for ever feeling any different!

Matt
Reply With Quote
  #24  
Old 02-09-2009, 01:38 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,040
Default Re: Joomla and mod_rewrite not working?

Quote:
Originally Posted by mcmattp View Post
I finally got it. I wasn't any of the above adjustments or commenting it out. I was saving or renaming the original file incorrectly, as well as a few config steps away from ever getting.

It has nothing to do with hostgator. I am sorry for ever feeling any different!

Matt
Great that you got it all sorted.
__________________
- David
Reply With Quote
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 02:25 AM.