[ALPHA] Pretty URLs

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
Locked
User avatar
Sam
Former Team Member
Posts: 2082
Joined: Thu Jan 22, 2009 3:59 am
Location: Sacramento, CA
Name: Sam Thompson
Contact:

[ALPHA] Pretty URLs

Post by Sam »

Modification Name: Pretty URLs
Author: Sam

Modification Description: Make your phpBB forum's URLs pretty!
Modification Version: 0.0.2

Requirements: Apache Web Server with mod_rewrite enabled

Features:
  • Automatically rewrites URLs being displayed
  • Redirects users to correct URLs if a wrong one is detected
Changes URLs from the following scripts:
  • viewforum.php?f=55 -> f55-my-forum-name.html
  • viewtopic.php?t=23 -> t23-my-topic-title.html
  • viewtopic.php?t=23&start=20 -> t23-my-topic-title_20.html
  • viewtopic.php?p=32 ->p32-my-topic-title.html
  • memberlist.php?mode=viewprofile&u=23 -> u23-sam.html
  • memberlist.php?mode=leaders -> leaders.html
  • memberlist.php?mode=group&g=2 -> g2-administrators.html
  • faq.php -> faq.html
  • viewonline.php -> viewonline.html
  • viewonline.php?sg=1 -> viewonline-sg.html
  • search.php?search_id=egosearch -> egosearch.html
  • search.php?search_id=unanswered -> unanswered.html
  • search.php?search_id=unreadposts -> unreadposts.html
  • search.php?search_id=newposts -> newposts.html
  • search.php?search_id=active_topics -> active-topics.html
Known Issues:
None yay!

Modification Download:
pretty_urls_0.0.2.zip (36.5 KiB)
pretty_urls_0.0.2.tar.bz2 (34.6 KiB)

Notes: With any "friendly" or "pretty" URL system there lies an inherent risk of data leakage via referrers. For example. say there is a topic on your staff board with the URL t98457-sam-is-causing-trouble.html, which is hidden from public view. Now whether I cause trouble or not is another matter entirely, but what might happen is when they link to my website as proof that I was causing trouble, that URL will be in the referrer, which I could easily identify via logs on my server. What I could find is the fact there is a private topic with a link to my website in it, and it happens to deal with me causing trouble. It is also worth noting that no other information can be exposed (assuming normal permissions have been set up properly).
Last edited by Sam on Tue Apr 23, 2013 6:56 pm, edited 6 times in total.
Reason: Version 0.0.2
User avatar
Stoker 4.0
Registered User
Posts: 1487
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: [ALPHA] Pretty URLs

Post by Stoker 4.0 »

Your install.xml says:
Open: styles/prosilver/template/index_body.html

I bet that is the wrong file ;)
User avatar
Sam
Former Team Member
Posts: 2082
Joined: Thu Jan 22, 2009 3:59 am
Location: Sacramento, CA
Name: Sam Thompson
Contact:

Re: [ALPHA] Pretty URLs

Post by Sam »

Stoker 4.0 wrote:Your install.xml says:
Open: styles/prosilver/template/index_body.html

I bet that is the wrong file ;)
Huh, that's cool... let's try that again.

Install file has been fixed.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: [ALPHA] Pretty URLs

Post by Peter77sx »

No edits to phpbb... pretty cool :)
User avatar
Stoker 4.0
Registered User
Posts: 1487
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: [ALPHA] Pretty URLs

Post by Stoker 4.0 »

I have installed it on a testboard and it is working fine as afar as I can see.

What if you uninstall if after google has indexed the pretty urls?
Do you include a reverse rewrite?
User avatar
Sam
Former Team Member
Posts: 2082
Joined: Thu Jan 22, 2009 3:59 am
Location: Sacramento, CA
Name: Sam Thompson
Contact:

Re: [ALPHA] Pretty URLs

Post by Sam »

Stoker 4.0 wrote:I have installed it on a testboard and it is working fine as afar as I can see.

What if you uninstall if after google has indexed the pretty urls?
Do you include a reverse rewrite?
I've not come up with a solution yet, but it would be entirely an htaccess one. Basically it would be a series of 301 forwards pointing back to the old URLs.

Likewise, after installing the current URLs will still work and most wont redirect (only the topic ones will fix themselves) to the proper one, this is on my todo list, actually.
User avatar
Stoker 4.0
Registered User
Posts: 1487
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: [ALPHA] Pretty URLs

Post by Stoker 4.0 »

Code: Select all

General Error
Tried to redirect to potentially insecure url.
The url was t8-g<sdggggg.html


Also redirects with æødoesnt work.
User avatar
Sam
Former Team Member
Posts: 2082
Joined: Thu Jan 22, 2009 3:59 am
Location: Sacramento, CA
Name: Sam Thompson
Contact:

Re: [ALPHA] Pretty URLs

Post by Sam »

Stoker 4.0 wrote:

Code: Select all

General Error
Tried to redirect to potentially insecure url.
The url was t8-g<sdggggg.html


Also redirects with æødoesnt work.
I was afraid support for those characters would be iffy.

As for the former, that should be an easy fix.
User avatar
Kamahl19
Registered User
Posts: 1598
Joined: Tue Nov 06, 2007 3:33 pm
Location: Slovakia
Name: Martin
Contact:

Re: [ALPHA] Pretty URLs

Post by Kamahl19 »

Hi,

nice mod, i like simple solutions.

Do you also rewrite names of forums? Or do you plan to add it?

Code: Select all

forum-name/subforum-name/t1-topic_name.html
User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 11073
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [ALPHA] Pretty URLs

Post by Raul [ThE KuKa] »

Very good MOD :)
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies | Styles Queue Stats :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate.
:flag_es: phpBB Spain - Online Since 2003 :heart:


User avatar
Sam
Former Team Member
Posts: 2082
Joined: Thu Jan 22, 2009 3:59 am
Location: Sacramento, CA
Name: Sam Thompson
Contact:

Re: [ALPHA] Pretty URLs

Post by Sam »

Kamahl19 wrote:Hi,

nice mod, i like simple solutions.

Do you also rewrite names of forums? Or do you plan to add it?

Code: Select all

forum-name/subforum-name/t1-topic_name.html
I don't have plans for that, mainly (to keep URL consistency) I fear code edits will be required. The idea behind this MOD was to create a pretty url solution with no core code edits.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: [ALPHA] Pretty URLs

Post by Peter77sx »

Stoker 4.0 wrote: What if you uninstall if after google has indexed the pretty urls?
Do you include a reverse rewrite?
Google webmaster tools is very useful for this. This is already OT but it comes with the baggage. :)

Also you can use canonical url's ? there is a tiny mod around here that does this. very useful since google takes canonical into consideration. then you'd wouldn't have to worry about 301 redirects.
User avatar
Sam
Former Team Member
Posts: 2082
Joined: Thu Jan 22, 2009 3:59 am
Location: Sacramento, CA
Name: Sam Thompson
Contact:

Re: [ALPHA] Pretty URLs

Post by Sam »

Peter77sx wrote:Also you can use canonical url's ? there is a tiny mod around here that does this. very useful since google takes canonical into consideration. then you'd wouldn't have to worry about 301 redirects.
I don't know if I will get to that soon.
User avatar
Stoker 4.0
Registered User
Posts: 1487
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: [ALPHA] Pretty URLs

Post by Stoker 4.0 »

Sam wrote:
Stoker 4.0 wrote:

Code: Select all

General Error
Tried to redirect to potentially insecure url.
The url was t8-g<sdggggg.html


Also redirects with æødoesnt work.
I was afraid support for those characters would be iffy.

As for the former, that should be an easy fix.
It has been done before, im sure it can be done again.

æ converts to ae
ø converts to oe
å converts to aa

Also I have noticed that when we have an error with this mod, the browser just continue to load without finding anything.
We need something to prevent this.
User avatar
Sam
Former Team Member
Posts: 2082
Joined: Thu Jan 22, 2009 3:59 am
Location: Sacramento, CA
Name: Sam Thompson
Contact:

Re: [ALPHA] Pretty URLs

Post by Sam »

Stoker 4.0 wrote:
Sam wrote:
Stoker 4.0 wrote:

Code: Select all

General Error
Tried to redirect to potentially insecure url.
The url was t8-g<sdggggg.html


Also redirects with æødoesnt work.
I was afraid support for those characters would be iffy.

As for the former, that should be an easy fix.
It has been done before, im sure it can be done again.

æ converts to ae
ø converts to oe
å converts to aa
Ah Okay, I'll do a little more research on how to implement the replacements. That should be fairly straight forward.
Stoker 4.0 wrote:Also I have noticed that when we have an error with this mod, the browser just continue to load without finding anything.
We need something to prevent this.
By that, do you mean it's just sitting there, loading forever?
Locked

Return to “[3.0.x] MODs in Development”