User Friendly URL's

  • I'm trying to set up the user friendly URL's but I'm having no luck getting it to work.

    I've copied the code from the help guide into the .htaccess file and changed the paths to match the install but it still won't work.

    My install structure looks like this:

    Core: var/www/site

    Forums: var/www/site/forum

    It's running on Ubuntu using apache2. Am I putting the file in the wrong place or am I just not changing the paths right?

  • Well, why would you want to edit paths? You can use the WoltLab example right away, you can shorten it of course.

    So the file should be: /var/www/site/.htaccess

    And the contence:

  • So I copied what you wrote exactly and put it in that folder and it didn't work...

    I then found an "allowoverride none" that I had missed in apache2.conf :rolleyes:

    I changed that and it's all working now. Thanks for the reply.

  • I then found an "allowoverride none" that I had missed in apache2.conf :rolleyes:


    If you have access to the apache2.conf, do me a great favor an reactivate allowoverride none immediately. Delete the .htaccess file at once. And then head to your vhost configuration for your domain. Edit the file look for <directory /var/www/site/> and add the rewrite rules there!

    Why? Because I didn't knew you had a well customized apache running. Disableing .htacess is the preferred default, it increases performance and security. But in some cases you need access to the vhost config; most hosters won't grant that to users, so they enable .htaccess.

    You might want to look for other (auto created) .htacess files, and move the contence to the vhost config. There is a neat little command to do that:

    find /var/www/site/ -name .htaccess -exec echo -n "<Directory " \; -exec dirname {} \; -exec echo ">" \; -exec cat {} \; -exec echo -e "\n</Directory>\n" \;

    This will check all sub-directorys for .htaccess files and display on the console the parameters you might want to add to the vhost config.