News:

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

Main Menu

Friendly URLs - About the .html

Started by carlatf, May 18, 2006, 06:21:53 PM

Previous topic - Next topic

carlatf

Hi,
Is there a reason I'm missing for putting .html after all the pages?

Can I erase it just deleting the html in here?:


// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);
else
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);
}

Best,
Carla


Leipe Po

i think that is used for the search engine friendly urls....
There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

carlatf

Yea but what's de difference between

index.php/board,29.0.html

and

index.php/board,29.0

To me without the .html is better and it allows you to create easily RSS links.
current url + rss code.

With the .html the RSS don't work....

Leipe Po

but without the .html the browser wont work,
there is a trick for that, so some sites have it like that, but thats not implemented in smf as far as i know,
maybe you should give it a try and see what comes out,(but allways back-up your files),

greetings, Leipe_Po
There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

mytreo

#4
I will have SMFSEO mod released in the next couple of days. See www.smfseo.org for details. Or follow this thread.... here

It will give you URLs like this:

      Flavour 1:
      http://www.example.com/smf/the-board-name/index.0.html
      http://www.example.com/smf/the-board-name/the-topic-name.0.html
      
      Flavour 2:
      http://www.example.com/smf/the-board-name/0/
      http://www.example.com/smf/the-board-name/the-topic-name/0/

Hope you like it!
Chris
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Harro

Would be awsome if it would also work in combination with MKPortal ;)
The build-in SEF url's don't work with MKPortal.
So I rewrote them myself a while back to eg http://harro.sin.khk.be/topic-5.html and /post-117.html and so on.
But I lost it after the last upgrade and waiting for SMF 1.1 to go final.

But I had no idea how to create them with the topic title in them. So it would be great if your modification also works with MKPortal :)

mytreo

I don't even know what MKPortal is, so don't hold your breath waiting if it requires extra modifications than what I already did to be "compatible"

(I don't see how URLs can be "incompatible" really, but I'll take your word for it)
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Harro

www.mkportal.it is the official site.
And when you display the forum inside the portal, the SEF url's don't work anymore.

carlatf

#8
Quote from: mytreo on May 19, 2006, 07:49:26 PM
      Flavour 1:
      http://www.example.com/smf/the-board-name/index.0.html
      http://www.example.com/smf/the-board-name/the-topic-name.0.html

Hi Chris! :)
That is AWESOME!. I was going to do  something like that by hand with mod rewrite!
You're going to be hailed and  loved by the webmasters who want more SEoptimized URLs.
It's a great contribution.


Btw, in my forum
/index.php/topic,744.msg5969
work as well as

/index.php/topic,744.msg5969.html
That why I was asking how to get a rid of the .html extension.

Best,
Carla

Advertisement: