Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Creating user friendly URL's throughout whole forum
![BIOS](https://secure.gravatar.com/avatar/149cf2eac752a94977fcb60ae1764da7/?default=https%3A%2F%2Fvanillicon.com%2F416cbe7355e01cc43acb2f4873cad325_100.png&rating=g&size=100)
Hey, I was wondering what would be the best way to create better and modify user friendly URL's with .htaccess for the forum, for example instead of it being http://localhost/forum/index.php?p=/discussion/1/something it would be something like http://localhost/forum/discussion/1/something and instead of http://localhost/forum/index.php?p=/profile/edit it would be http://localhost/forum/profile/edit
0
Comments
You don't need to do that on the .htaccess you can do it in "dashboard/routes" There you can modify routes to be more user friendly.
http://vanillaforums.org/page/routes
Ah nice, was just wondering how I'd change forum/index.php?p=/profile/1/username to forum/profile/username because it gets their userID and username?
read the documentation on rewrite of urls and the associated config statement and .htaccess changes.
come back in a month to post more questions, after you take time to read documentation and tutorials.
you seem to ignore the documentation.
also try searching the forum and re-reading the links to tutorials provided to you in other discussions.
if english is not your primary language, post question in your native language, if you don't understand the english language.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I've read about other posts and I've got pretty URLs enabled but just didn't know how it would go about doing this
forum/index.php?p=/profile/1/username OR with pretty URL it is forum/profile/1/username to forum/profile/username (Removing the UserID from the link is what I'm basically trying to achieve)
if you remove the userid - it goes to the profile of the logged in user -you. other wise it will go to the profile of the user who indeed not be you. Depends on where you click, there is no one size fits all and if you remove the id via routing you will break other links.
sounds like a tempest in a teapot.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Removing the ID from all the internal links vanilla creates isn't really possible, but you can access profiles even without the ID:
http://vanillaforums.org/profile/BIOS
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
so your question once again is entirely different then what you posted in you opening post.
I suggest you read the links on how to ask questions.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Ah so there's no easy method to do it really then, I was trying to make it so that if you went to either forum/profile or forum/profile/yourUsername (it would go to your profile if as session exists if not it would redirect you to the index) but if you went to another such as forum/profile/SomeoneElsesUsername it would show you their profile.
It isn't because I'm trying to overall create user friendly URL's, the profile example is just one of the things that I wanted to change it's still the same stuff.
http://vanillaforums.org/discussion/18015/how-to-ask-questions-on-the-internet
http://vanillaforums.org/discussion/23130/forum-post-ettikett-etiquette
http://vanillaforums.org/discussion/25115/how-to-how-can-a-new-user-better-help-the-community-
http://vanillaforums.org/discussion/17954/food-for-thought-forum-etiquette
http://vanillaforums.org/discussion/23483/advice-for-all-those-just-starting-out-with-vanilla
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
There isn't any reason to create a new thread when I'm trying to create user friendly URLs which the profile example I gave would go under that?
@BIOS your initial question was about how to turn on rewrite rules, that is plain as day.
You changed the ball park without acknowledging doing so.
grep is your friend.
@BIOS
Add the following to conf/config.php
$Configuration['Garden']['RewriteUrls'] = TRUE;
This is to create "pretty urls" for anyone else looking for the answer. Modifying anything else can be via Routes or .htaccess.
Nope, i was asking what would be the best way to create user friendly URLs with .htaccess and then someone told me about the routes, I already know how to turn on Rewrite rules, infact it's on by default with the .htaccess that comes with Vanilla just doesn't look great, lol.
Yup, already had that before. I was trying to further modify the URLs but it's believed to be not easily achievable without editing the core -- My question has been previously answered.
A few things that might help you in the future.
see the link on how to ask a question.
realize if you have so much confusion in your thread, you didn't pose a clear enough question.
acknowledge that you changed questions mid-stream
If English is not your native language, perhaps someone can translate the above links to the language you are fluent in speaking and understanding.
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I never went off topic, you are doing it now by continuing to reply to a thread about English where the answer has already been answered?
My questions were all regarding the same thing. (Creating user friendly URLs can be related to .htaccess, routes, and once again changing the profile URL would also be related also since what i'm trying to achieve from it is a "user friendly URL".)
Further replies to the discussion aren't required to the thread as it's already been answered.
This is actually pretty easy to do.
Extend Vanilla's controllers. E.g.
Extend models as necessary in your hooks file.
Override the associated render functions to use your new scheme. I would use the bootstrap file for this. E.g.
Now you have discussion URLs of the form
http://forums.example.com/d/discussion-name-no-ugly-ids
. You just need to repeat this process for any other controller you want to prettify.EDIT - If it is not obvious, I think this is a bad idea. That said, we have different requirements.![:) :)](https://open.vanillaforums.com/plugins/emojiextender/emoji/little/smile.png)
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.