"queryless_urls" func addition - how to change "/index.php/" to "/" ?

Started by Vedm, October 30, 2004, 06:47:02 PM

Previous topic - Next topic

Vedm

Forum is installed in "***.com/forum/" directory, and I have switched on the "Show URLs without ?'s", which starts "queryless_urls"-function in Admin Panel's "Edit Features and Options". So now all URLs come looking like "***.com/forum/index.php/topic,1.0.html".

First and the main one, I want to get rid of virtual "index.php/" dir;

Second I want to have all my boards and topics look more plain, like ".../topic1.0.html" (and of course ".../topic1" too), without the "," in the middle;

Third I want to apply short names to boards, for example "***.com/forum/board1.0.html" to be "***.com/forum/news/" and so on.

Looks like I don't have an access to .htaccess file on my hosting at the moment, so how can I make all these changes by use of SMF coding? Some additions to "queryless_urls" function? But where is it and how to?

Please provide detailed code if it's possible - I'm a PHP newbie :(.

Thanks in advance!
My Forum runs under SMF 1.0 RC1

dschwab9


Vedm

But how did SMF itself? It has already switched these mod_rewrite things on, isn't it? So I thought a small addition to initial "queryless_urls" function would help... What's so wrong in it?
Sorry if my question is dumb.
My Forum runs under SMF 1.0 RC1

[Unknown]

No, SMF is just taking advantage of the fact that index.php/sdfkldsjflksdjf calls index.php.  To remove index.php, you will need to use mod_rewrite - otherwise, you would think we would have removed index.php ourselves, wouldn't you?

Do you have access to your .htaccess?

-[Unknown]

Vedm

Thank you for the explanation.

I don't have access, neither my own .htaccess'es yet (hoster is rebuilding its system), but "www" dir I hope will become writeable today. So I make .htaccess in "/www/" dir, right?
Okay, so what Rules should I type into it to have the beforementioned?
My Forum runs under SMF 1.0 RC1

[Unknown]

RewriteEngine on
RewriteRule /forum/(.*) /forum/index.php/$1

I think that should work, but I might be wrong.  But, then you'd have to modify SMF to use it... first, can you try this and see if links like the following actually go to the right place?

http://www.example.com/forum/topic,5.0.html

If that works, this might:

RewriteEngine on
RewriteRule /forum/topic/(.*) /forum/index.php/topic,$1
RewriteRule /forum/board/(.*) /forum/index.php/board,$1

http://www.example.com/forum/topic/5.0.html

-[Unknown]

Vedm

My Forum runs under SMF 1.0 RC1

Advertisement: