solved SEO SEF URLs htaccess and ubuntu or wamp

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
teacherluck
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Feb 28, 2011 10:08 pm

solved SEO SEF URLs htaccess and ubuntu or wamp

Postby teacherluck » Tue Mar 22, 2011 10:07 am

I thought I'd help out, as this seems to be a common problem with very little complete advice, and a lot of bad advice. The Ubuntu docs only get Joomla installed, and don't go as far as enabling SEF URLs. I plan to put this into the docs pages somewhere soon.

Problem: For some people they can rename their htaccess file and click 3 radio buttons to get SEO options working.

For others... It fails. You've made an Ubuntu or WAMP server but the CMS website it's hosting can't use SEF URLs. You've followed the documentation for Joomla (or any CMS) to create SEF URLs, but it's broke. You can even get it working on a a site hosted by godaddy.com or hostgator.com - Perhaps you don't care about SEF URLs and you are trying to use the features of htaccess, yet it's broke.

In the example below I was using Ubuntu and the Joomla CMS installed into a folder called "joomla" with the sample content, and all 3 SEO settings=yes in the global configuration. XAMPP servers seem to have mod_rewwrite working with the default installer. WAMP needs the same fixes as Ubuntu.


errors observed in your web browser:

The server encountered an internal error or misconfiguration and was unable to complete your request
or
The requested URL /joomla/example-pages.html was not found on this server



steps for ubuntu server:
===========================================

1)go to the ubuntu command line

2)type the command: sudo gedit /etc/apache2/sites-available/default

notes: This is the default server configuration file using ubutu server

3) Make 2 changes to the code, see default code below
original: AllowOverride None
new: AllowOverride All

========segment of default code ===================

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

=========code end=======================

4) Save and close gedit


5) type the command: sudo a2enmod rewrite

notes: the ApacheENableModule tool (a2enmod) now enables the "rewrite" module for good. The next time you reboot, the module loads automatically

6) type this command: sudo /etc/init.d/apache2 restart

notes: this restarts the apache2 web server without rebooting your pc



7) test that .htaccess files are being loaded properly by apache

type the command: sudo mkdir /var/www/foofolder
type the command: sudo gedit /var/www/foofolder/.htaccess

in the file add these 2 lines below
Options +FollowSymLinks
Redirect /foofolder/foo.html http://www.google.com

Save and close gedit

8) Open a browser and test your server URL by adding foofolder/foo.htm

example url: localhost/foofolder/foo.html
result, you should see google

9) Follow the steps for SEF Urls in your docs for your CMS website
SEF = Search Engine Friendly
(the opposite of long URL's with querry strings)

10) For the Joomla CMS you would rename the default file
from: htaccess.txt
to: .htaccess
and set all 3 SEO settings to "yes" in the Joomla back end, global configuration

ubuntu command line: sudo mv /var/www/joomla/htaccess.txt /var/www/joomla/.htaccess

11) Done


Steps for a Wamp Server
===============================
use notepad to edit the file
c:\wamp\bin\apache2.2.11\config\httpd.conf

Your folder may have a different apache version

search for the text "rewrite"
remove the pound symbol # - at the start of that line of text

search for the text "None"
change it to "All" in both places as noted in step 3 above

save and exit notepad

click start, run, cmd.exe
type the commands
c:
cd\
cd wamp
cd www
cd joomla
rename htaccess.txt .htaccess

use the mouse to click the wamp menu stop all, then start all

sudeep
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jun 03, 2010 8:54 am
Location: United Kingdom
Contact:

Re: solved SEO SEF URLs htaccess and ubuntu or wamp

Postby sudeep » Mon Sep 19, 2011 1:33 pm

Thanks a lot. I have been on my test server with non-SEO URL friendly since an year. Your article is really helpful as now I can develop my components with SEO friendly URL

teacherluck
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Feb 28, 2011 10:08 pm

Re: solved SEO SEF URLs htaccess and ubuntu or wamp

Postby teacherluck » Fri Sep 23, 2011 1:00 am

THanks. For Ubuntu you only need to do steps 1-5 and then reboot.

Steps 6-11 verify you've done the fix completely.

User avatar
IMspintheweb
Joomla! Intern
Joomla! Intern
Posts: 83
Joined: Tue Sep 27, 2005 4:09 pm
Location: Golden, CO
Contact:

Re: solved SEO SEF URLs htaccess and ubuntu or wamp

Postby IMspintheweb » Wed Oct 09, 2013 4:22 pm

Excellent find!

Thanks for posting

User avatar
enbees
Joomla! Guru
Joomla! Guru
Posts: 860
Joined: Mon Sep 20, 2010 7:58 am
Location: Jakarta - Indonesia
Contact:

Re: solved SEO SEF URLs htaccess and ubuntu or wamp

Postby enbees » Thu Dec 26, 2013 10:33 am

Thanks alot!! I've been looking for this for my WAMP server at the local computer for so long. Great Job.
Regards,
enbees, I'm here: http://koperasoft.com

sophiesowmy
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Jun 08, 2015 7:53 am

Re: solved SEO SEF URLs htaccess and ubuntu or wamp

Postby sophiesowmy » Sun Jun 28, 2015 6:01 am

Thanks alot... used to setup server conf in local... working fine,


Return to “Administration 1.5”

Who is online

Users browsing this forum: No registered users and 8 guests