I currenlty installed Joomla CMS but I can not get it to generate SEO friendly urls. This is the site. http://www.host-mega.com The admin area says to rename htaccess.txt to .htaccess but there is no txt file I did find the .htaccess file in my root. ## # @version $Id: htaccess.txt 2368 2006-02-14 17:40:02Z stingrey $ # @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 ## ##################################################### # 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. # # Only use one of the two SEF sections that follow. Lines that can be uncommented # (and thus used) have only one #. Lines with two #'s should not be uncommented # In the section that you don't use, all lines should start with # # # For Standard SEF, use the standard SEF section. You can comment out # all of the RewriteCond lines and reduce your server's load if you # don't have directories in your root named 'component' or 'content' # # If you are using a 3rd Party SEF or the Core SEF solution # uncomment all of the lines in the '3rd Party or Core SEF' section # ##################################################### ##### SOLVING PROBLEMS WITH COMPONENT URL's that don't work ##### # SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED # OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING # # In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line: # RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## # May need to be uncommented. If you are running your Joomla/Mambo from # a subdirectory the name of the subdirectory will need to be inserted into this # line. For example, if your Joomla/Mambo is in a subdirectory called '/test/', # change this: # RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## # to this: # RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes## # ##################################################### ## Can be commented out if causes errors, see notes above. # Options FollowSymLinks # # mod_rewrite in use # RewriteEngine On # Uncomment following line if your webserver's URL # is not directly related to physical file paths. # Update Your Joomla/MamboDirectory (just / for root) # RewriteBase / ########## Begin Standard SEF Section ## 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 Standard SEF Section ########## Begin 3rd Party or Core SEF Section # #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 or Core SEF Section PHP: Please help.
The hashes at the beginning of the line tell the htaccess to ignore the text after it. You need to find the code that makes it search engine friendly, sorry I cant be of more help but I've never used Joomla.
Actually try this ... # RewriteEngine On # # Uncomment following line if your webserver's URL # # is not directly related to physical file paths. # # Update Your Joomla/MamboDirectory (just / for root) # RewriteBase / # ########## Begin Standard SEF Section # ## 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 PHP:
I tried that and I was getting a 500 internal server error Not sure what the problem is, the server allows me to use mod rewrite on because I had another CMS and it did generate seo friendly url's. Anything else to try?
What version of Joomla are you using? It's bizarre that: a) all the lines are commented out; and b) .htaccess was already named as such. Did you install it yourself, or via Fantastico or one of those things? I'm assuming you are using 1.0.8, as I just checked the version number at the top of the htaccess.txt file that I have and they're the same. I have attached the file that I have. If you compare the one I have attached to the one you copied here, you will see that the following lines have been uncommented: Options FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC] RewriteRule ^(content/|component/) index.php Code (markup): To help things go smoothly, I recommend this process: Firstly, rename htaccess.txt to .htaccess then try and access your site: follow a few links and make sure it's working. The SEF side of things won't be working yet, but this way you test that the htaccess is OK. If it's not working (you'll get server errors), you'll generally find that commenting out the line: Options FollowSymLinks Code (markup): will fix it. Once you know that the htaccess is OK, go in to your Joomla global configuration and enable SEF. Simple as that. You may then want to install OpenSEF or something like that to then enable 'user friendly URLs', not just SEF URLs. Hope this helps!
nice one twistmyarm! I had a few issues but i snooped around on the open-sef and joomla forums and foundd the issues with my htaccess file and a sample of what it should looke like, this fixed it right up
Thanks a lot for your help, but for some reason when I changed the .htaccess file to Options FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC] RewriteRule ^(content/|component/) index.php I get a 404 not found?? Not sure what the problem is
netmaster123: As per my original comment, have you tried commenting out the 'Options FollowSymLinks' line?
DirectoryIndex index.php RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php I have this running on one of my Joomla sites as the .htaccess and it seems fine.
Wooooo Hoooo I got it to work. Hey thanks guys I really apreciate this help!! Check it out http://www.host-mega.com
netmaster123: Doesn't seem like it's working for you: Parse error: syntax error, unexpected T_VARIABLE in /home/hostmega/public_html/config.php on line 3 Code (markup): Anyway, I've found this thread after encountering the same problem and I also just installed for the 1st time Joomla on one of my sites & I cannot get it to show friendly urls, actually can anyone give me an example of a Joomla based site that shows friendly urls, so I could see what is the difference exactly...
"SEF urls", as in out-of-the-box Joomla, is just hiding any query strings by using rewrite URLs such as /content/view/22/5/ instead of /index.php?option=com_ content&task=view&id=22&Itemid=5 I'd be more interested in the OpenSEF setup, I've spent too many hours trying to get it to work now.
http://dashboardtemplates.com/ with the following: RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php