Jump to content


Friendly URL's 0.6.x (Apache)


226 replies to this topic

#31 The Bearded One

    Etomite Forum Newbie

  • Member
  • 14 posts

Posted 22 October 2004 - 04:50 PM

I got the .htaccess file and the Friendly URLs to work!

I'm really getting to love this Etomite CMS.

Thanks for the help.

Gary :P

#32 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 31 October 2004 - 09:31 PM

Hi Alex, I'm struggling to get friendly urls working - they worked on my last host, but on my new server they dont seem to work - i have asked the centre tech support and they tell me that mod_rewrite is installed, but when I access the site, I get an error message:

HTTP Error 403 - Forbidden
Internet Explorer

I know it's not my .htaccess file, as i'm using the exact same one from my old host :(


any advice is appreciated.

Dean

#33 nikolajb

    Etomite Forum Newbie

  • Member
  • 47 posts

Posted 01 November 2004 - 07:20 AM

Alex, on Oct 15 2004, 09:04 PM, said:

I think your best bet is to ask your host if the rewrite engine is installed. There's not really any other way to see if it is...

According to my host, it is... Are there any FAQ's on the topic somewhere? Or just some extended info on the settings? The explanation in the htaccess file don't really help me much :)

#34 pcwacht

    Etomite Forum Fan

  • Member
  • Pip
  • 135 posts

Posted 01 November 2004 - 07:27 PM

nikolajb, on Nov 1 2004, 09:20 AM, said:

According to my host, it is... Are there any FAQ's on the topic somewhere? Or just some extended info on the settings? The explanation in the htaccess file don't really help me much :)

Check the rights on .htaccess and ownership
Apache returns a 403, access forbidden, might be when it is trying to access the .htaccess

Good luck,
John

#35 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 01 November 2004 - 10:03 PM

pcwacht, on Nov 1 2004, 08:27 PM, said:

Check the rights on .htaccess and ownership
Apache returns a 403, access forbidden, might be when it is trying to access the .htaccess

Good luck,
John

nope, still not working.... i chmodded it to 777 - still error 403

has anyone got the text handy that should be included within the .htaccess file, incase the one that I have isn't somehow correct.

ta

Dean
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Is this the same as everyone else has got? as it isnt working for me - my server centre hsa suggested:

Quote

Have you tried switching on rewrite logging and bumping up the debug level to see whats going on?
but I dont have a clue where to look :(

#36 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 01 November 2004 - 10:16 PM

Aha - I've had a little progress - can anyone suggest a fix?

It's like the .htaccess is sending it somewhere else - although my site is actually in the root of the site ?

Forbidden, perhaps you need to change the file permissions for this document or upload an index page.

#37 summean

    Etomite Forum Fan

  • Member
  • Pip
  • 89 posts

Posted 02 November 2004 - 03:03 AM

Try adding this to your .htaccess file if your site is located at the root of your domain name (i.e. mydomain.com):

RewriteBase /


#38 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 02 November 2004 - 11:59 AM

nope, that doesnt work - any more suggestions before friendly urls go out the window?

Dean S

#39 Mr. Tech

    Etomite Forum Fan

  • Member
  • Pip
  • 65 posts

Posted 03 November 2004 - 10:33 PM

deanstev, on Nov 1 2004, 04:03 PM, said:

...has anyone got the text handy that should be included within the .htaccess file, incase the one that I have isn't somehow correct.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Is this the same as everyone else has got? as it isnt working for me...
I'd like to start this post with a disclaimer that I don't claim to know what I'm doing, I guessed my way through this problem a while ago.

In :eto: RC2 my friendly URL's were working fine but when I update to :eto: .06 it wouldn't work anymore. When I compared the .htaccess files from both versions, I found these 2 extra lines in the latest version of :eto: :

php_flag zlib.output_compression On
php_value zlib.output_compression_level 5

I'm sure I did a bad bad thing by removing these two lines of code, but the site still works and more importantly, my friendly URL's started working again.

Hope this helps...

#40 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 04 November 2004 - 10:27 AM

php_flag zlib.output_compression On
php_value zlib.output_compression_level 5

No my .htaccess doesn't have that in... thanks anyway... :(

#41 deko

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 13 November 2004 - 02:25 PM

Quote

Now that you've renamed ht.access to .htaccess and that your 3 statements are uncommented you should add a new directive to .htaccess. The directive is RewriteBase.

Is it important to add this RewriteBase line in? I seem to have friendly url's working fine once I renamed ht.access to .htaccess and turned it on in the manager section?

The default .htaccess file reads:

# To use friendly URLs for Etomite you need to uncomment the three Rewrite directives
# Make sure RewriteBase points to the directory where you installed Etomite
# e.g. / if your installation is in root
# or /Etomite if your installation is in the Etomite subdirectory
# 
#
# You must be running on Apache with mod_rewrite to be able to use this functionality.
#

php_flag zlib.output_compression On
php_value zlib.output_compression_level 5

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

The three Rewrite directives were not commented out in the first place, and there is no RewriteBase line to be seen. In order to make the top comments valid am I right to assume the default ht.access file should be like this:

# To use friendly URLs for Etomite you need to uncomment the three Rewrite directives
# Make sure RewriteBase points to the directory where you installed Etomite
# e.g. / if your installation is in root
# or /Etomite if your installation is in the Etomite subdirectory
# 
# You will also need to rename this file from ht.access to .htaccess
#
# You must be running on Apache with mod_rewrite to be able to use this functionality.
#

# Rewrite directive 1
#RewriteEngine On

# If your installation is in root - RewriteBase /
# If your installation is in the Etomite subdirectory - RewriteBase /Etomite
#RewriteBase /

# Rewrite directive 2
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite directive 3
#RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

(I have removed the two lines on "zlib.output" as Alex suggested earlier.)

Alternatively the file could take this appearance:

# To use friendly URLs for Etomite you will need to rename this file from ht.access to .htaccess
# Make sure RewriteBase points to the directory where you installed Etomite
# e.g. / if your installation is in root
# or /Etomite if your installation is in the Etomite subdirectory
#
# You must be running on Apache with mod_rewrite to be able to use this functionality.
#

RewriteEngine On

# If your installation is in root - RewriteBase /
# If your installation is in the Etomite subdirectory - RewriteBase /Etomite
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Thanks

Deko

#42 sholdowa

    Etomite Forum Newbie

  • Member
  • 32 posts

Posted 15 November 2004 - 08:46 AM

I just can't seem to get them to work.
1. According to the modules.conf, I'm loading mod_rewrite.so on apache 1.3.31.
2. I've loaded etomite into a Virtual Directory on my webserver, in it's own root directory.
3. .htaccess, owner by www-data:www-data, permissions 640, contents
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
4. Config. Use Friendly urls yes, prefix blank. suffix .html, friendly aliases yes.
5. document 17, document's alias about ( I've tried about.html, too )
6. Document 16, <a href="about.html", ... click ->
Not Found
The requested URL /about.html was not found on this server.

Hair... very little (:

Any suggestions?

Steve

#43 Guest_Alex_*

  • Guests

Posted 15 November 2004 - 10:16 AM

Thanks, that's a good idea. I'll use that htaccess in future releases ;)

#44 Guest_Alex_*

  • Guests

Posted 15 November 2004 - 10:23 AM

I don't know too much about modules.conf, as I do everything in httpd.conf on Apache 2, but can you load mod_rewrite through the httpd.conf file?

Also, in Eto, go to 'system info' and click on the link for phpinfo. Scroll down to the apache section, and check the loaded modules to see if mod_rewrite is loaded.

-Alex

#45 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 15 November 2004 - 12:56 PM

Hi, I've just been in touch with the server datacentre support, and just had another reply....

Alex, should it make a difference????

Quote

I can confirm mod_rewrite is installed on your server - the reason phpinfo
isn't picking it up is that php is run as a cgi and wont be able to detect any
of apaches internals.
And i've just checked the error logs:

Quote

Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /domains/b/a/**DOMAINNAME**/public_html


#46 Guest_Alex_*

  • Guests

Posted 15 November 2004 - 05:07 PM

Not too sure on the CGI thing, but the second thing basically says that your not allowed to use URL rewriting, which is what Friendly URLs use to work.

Maybe you can ask your host about this. My knowledge of url rewriting is limited to getting it to work on module based php setups, not CGI ones. My guess (and it is only a guess) is that they need to allow you to use Options in htaccess. They can change this in Apache's main httpd.conf file...

#47 sholdowa

    Etomite Forum Newbie

  • Member
  • 32 posts

Posted 15 November 2004 - 07:32 PM

Alex, on Nov 15 2004, 11:23 PM, said:

I don't know too much about modules.conf, as I do everything in httpd.conf on Apache 2, but can you load mod_rewrite through the httpd.conf file?

Also, in Eto, go to 'system info' and click on the link for phpinfo. Scroll down to the apache section, and check the loaded modules to see if mod_rewrite is loaded.

-Alex

phpinfo shows mod_rewrite loaded. php 4.3.4 if it makes any difference. Debian still uses modules.conf... they can't help being behind the times (:

Steve

#48 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 15 November 2004 - 08:03 PM

They've just sorted it... you may want to get copy and paste ready incase anyone else needs it:

Options FollowSymLinks IncludesNoExec ExecCGI

Adding this to the .htaccess makes it work like a dream! :)

#49 pcwacht

    Etomite Forum Fan

  • Member
  • Pip
  • 135 posts

Posted 15 November 2004 - 10:12 PM

deanstev, on Nov 15 2004, 10:04 PM, said:

Try adding the following to your .htaccess file - it worked for me :)

Options FollowSymLinks IncludesNoExec ExecCGI

And don 't forget
AllowOverride all
just beneath that sentence, otherwise .htaccess won't be evaluated...

#50 sholdowa

    Etomite Forum Newbie

  • Member
  • 32 posts

Posted 16 November 2004 - 01:09 AM

pcwacht, on Nov 16 2004, 11:12 AM, said:

And don 't forget
AllowOverride all
just beneath that sentence, otherwise .htaccess won't be evaluated...

Nope...

But then I'm not using symbolic links, includes or cgi scripts to the best of my knowledge ):

Steve





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users