Topic: Mod-rewrite

I would like to have Search Engine friendly url's, does someone now what lines I should put in my htaccess to get url's like:

http://pun.site.com/forum/1
http://pun.site.com/topic/1

Thans in advance

Re: Mod-rewrite

I would also like to know, and I'm too lazy to check it out myself :D

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Mod-rewrite

mod_rewrite is famous for its incredible lack of useful, human-readable documentation. sad

4 (edited by Eric_974 2004-04-06 00:44)

Re: Mod-rewrite

Hi guys, I 've just finished mod_rewriting PunBB, although it is not he way you want : I 've chosen to rewrite "viewforum-1.html" instead of viewforum.php?id=1 for example.
If you want to see it in action go to http://www.babouk.net/forums/ (it is still under construction but i don't think you'll care)


If you have mod_rewrite activated here's the code to put in your .htaccess
--------------------------------------------------------------------
RewriteEngine on
RewriteRule ^viewforum-([0-9]+)\.html$ /punbb/viewforum.php?id=$1[L]
RewriteRule ^viewtopic-([0-9]+)\.html$ /punbb/viewtopic.php?id=$1[L]
RewriteRule ^viewtopicp-([0-9]+)\.html$ /punbb/viewtopic.php?pid=$1[L]
RewriteRule ^profile-([0-9]+)\.html$ /punbb/profile.php?id=$1[L]
---------------------------------------------------------------------
Of couse "punbb" is the name of the directory you've installed Punbb in.

Beware bas use of mod_rewrite can crash the server, As soon as I can I 'll post a tutorial.

Re: Mod-rewrite

That's fantastic Eric !  My url's were just for illustration. Thanks a lot.

6

Re: Mod-rewrite

How do you do the change of table colour on mouse-over?

7

Re: Mod-rewrite

What do I have to do to punBB to get it to output the search engine friendly URLs inside the script?

8

Re: Mod-rewrite

Was bored, thought "stuff it", here it is:
http://punres.cactuz.nu/?p=projects/desc&id=25

Please don't tell me how bad the code is, i'm tired and I really don't care at the moment.

After finishing it I have decided that punBB is not the board for me, and that I will be writing my own forum software.

Re: Mod-rewrite

Hi,
i would like to change my forum ngine friendly too, but all answers dowsnt work for me ...
Have anybody a good mod for this problem ...?

Thanks a lot...
Michaela

Re: Mod-rewrite

your forum IS search engine frinedly contrary to popular belief PunBB can be indexed by search engines, there is no need for urls like that (although they look pretty neat)

Re: Mod-rewrite

its not working for me..  and mod_rewrite its enable.. sad

Re: Mod-rewrite

whats not working?

13

Re: Mod-rewrite

hubabuba, I guess you have "AllowOverride None"
so .htaccess cant make any "override" changes to configurable stuff.

14 (edited by hubabuba 2005-05-09 23:16)

Re: Mod-rewrite

its working big_smile

Re: Mod-rewrite

but..

i have:    /forum/viewforum-9.html
and        /forum/viewforum.php?id=9

how can i lose   ..php?id=9

thx smile

Re: Mod-rewrite

and btw

in this case: forum/viewtopic.php?id=24&p=2 what rules i should put ?
/punbb/viewtopic.php?pid=$1[L]  will not work..