News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Queryless URL's - how do they work?

Started by Curbow 5, June 15, 2004, 09:33:04 AM

Previous topic - Next topic

Curbow 5

Common sense dictates they should use Apache's mod_rewrite. I found all the querystring rewriting stuff in Querystring.php, but I can't seem to find any reference to a .htaccess file or the RewriteEngine anywhere...

How does this work in SMF? ???

Skoen

You can set urls to be queryless in your admin panel -> in the Mod Settings -> just below the Moderator log setting. Activate it, hit Save and the forum should have queryless urls.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Curbow 5

LOL I'm sorry, I must've not been clear. I know how to activate the queryless URL's; I was asking how they work technically: what happens codewise when I hit that checkbox and save.

Thanks for helping though!  ;)

[Unknown]

Apache, in most configurations, will send:

index.php/some/stuff

To index.php.

-[Unknown]

Curbow 5

i see... so there's no .htaccess with rewriting rules?
also, which configuration specifically is needed?

thanks!

[Unknown]

In Apache 2, AcceptPathInfo....

-[Unknown]

Curbow 5


[Unknown]

There is no setting for Apache 1...... it should just work, as long as it's compiled normally.

-[Unknown]

Curbow 5

thanks [Unknown] !!! I learned stuff once again! :)

Anguz

I first learned about Apache's PATH_INFO when I read this article at SitePoint

Search Engine-Friendly URLs

check out Method 1
Cristián Lávaque http://cristianlavaque.com

Skoen

Wow what a hint... sorry my sarcasm, but that link didn't work very well, all I saw was the number... "1" on the site.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Bartrainer

The link works fine, interesting article. I never knew that search engines didn't index url's with"?" in them. Very good to keep in mind.

YUK
Everyone that says "it can't be done" is followed by someone that just did it.  The possibilities are as Powerful as your imagination...

"There are No bad cocktails, just bad drinkers."

Curbow 5

My host runs Apache 2.0 Filter with AcceptPathInfo set to off. I uploaded a .htaccess with the following content:

<Files "index.php">
AcceptPathInfo On
</Files>


The path_info stuff seems to work now, except that it no longer seems to load my stylesheet.... Compare http://www.jubile.nl/index.php/path_info/stuff to http://www.jubile.nl/index.php

Do I need to add something else to the .htaccess?

Anguz

I think that's because the browser is looking for your CSS relative to
http://www.jubile.nl/index.php/path_info/stuff/
it's trying to find it here
http://www.jubile.nl/index.php/path_info/css/classes.css

change this

<link rel="stylesheet" href="css/html.css" type="text/css" />
<link rel="stylesheet" href="css/classes.css" type="text/css" />


to this

<link rel="stylesheet" href="/css/html.css" type="text/css" />
<link rel="stylesheet" href="/css/classes.css" type="text/css" />


the same will be true for any other link that's relative to the one calling it, including internal anchors that don't specify the file since they're anchored to the same file, like

<a href="#anchor">I'm an anchor</a>

using your example URL, it should be written like this

<a href="/index.php#anchor">I'm an anchor</a>
Cristián Lávaque http://cristianlavaque.com

Skoen

Weird, cause it seems like Google indexes some of the topics on my board.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Curbow 5

Quote from: Anguz on June 16, 2004, 03:33:14 PM
I think that's because the browser is looking for your CSS relative to
http://www.jubile.nl/index.php/path_info/stuff/
it's trying to find it here
http://www.jubile.nl/index.php/path_info/css/classes.css

i kinda figured that would fix it, but i was hoping i did something wrong in the .htaccess, so I wouldn't have to change all my paths...  :-\

Curbow 5

any apache2 guru's around to settle this? :)

Advertisement: