Hello,
I want to remove /pg/ in elgg's urls, for example, I want to convert this:
http://community.elgg.org/pg/bookmarks/user1/items
in:
http://community.elgg.org/bookmarks/user1/items
Is it posible? Someone can help me?
Thanks!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- Javi@jcadenas
Javi - 0 likes
- Alexander Leschinsky@lazybadger
Alexander Leschinsky - 0 likes
- Javi@jcadenas
Javi - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Javi@jcadenas
Javi - 0 likes
- slowsoulz@slowsoulz
slowsoulz - 0 likes
- lord55@lord55
lord55 - 0 likes
- Blue@OnlyBlue
Blue - 0 likes
You must log in to post replies.This is not an Elgg issue but a mod_rewrite issue. You can do this with .htaccess, albeit with quite a bit of effort.
In my view, you are asking for a world of trouble in exchange for slightly shorter URLs. I very much doubt that it is worth the effort. But in theory you could do it.
Thanks for your response Kevin.
I think it's necessary .htaccess too but I suppose it's not posible to do this without code changes because all urls are hardcoded. So I need to change all links in views (/pg/bookmarks/ to /bookmarks/) and then with .htacces translate /bookmarks/ into /pg/bookmarks/, and this with all urls one by one. As you say, It's a lot of effort.
Javi, if my memory still serves me, you have to edit 2 lines in .htacess
UPD!There are at least 33 files in Elgg 1.5, which have hardcoded pg/ substring inside, you have to hack these places too. Well, now I'm on board with Kevin in "it is worth the effort"
Thanks Alexander but it's not so simple ;-). With your solution all links in aplication are the same because they are hardcoded.
Every now and then yet another thread on this topic ;-)
people should do a search first
http://groups.google.com/group/elgg-development/browse_thread/thread/8d247e9b52c39295/b9a1106c6a64174?hl=en-GB&q=#0b9a1106c6a64174
http://community.elgg.org/mod/groups/topicposts.php?topic=79757&group_guid=52477
Dhrup, I did a search first and I did'n found nothing, so I did a question here ;-)
I can`t see any solution in your links, they go to a home page, could you copy your answer here or tell me what is the group where your post is?
Thanks
Like Alex and Kevin both stated, there are many files in ELGG that would need to be changed.
BUT the fix allows you to use this as a link, freakybehavior.com/msmagic32 and it will go to your profile. The browser will still say http://www.freakybehavior.com/pg/profile/msmagic32, but the link can leave the pg/profile/*** out !
So while you aren't exactly getting the "pretty url" that you want, you are able to use "pretty urls" and have them work! At least for the profile.
i see that elgg uses username to go on profile
pg/profile/username
but in registration it requires also public name so it's more correct to show public name to cut confusion with username that is only for login ... if not is better to have only username for all.
if i want to give my seo profile url to a friend i give my public name ....because i always see it on site...
so it's important to think to this for a correct rewrite rule.
thisi is what i think.
It's useful.