MyBB Community Forums

Full Version: Make Urls End With A Trailing Slash?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Our forum address is in my signature.
i am using google seo plugin
and as of now the urls end without a trailing slash like this
https://www.braindirector.com/forum/thre...s-for-kids
i want them to end with a trailing slash like this
https://www.braindirector.com/forum/thre...-for-kids/
i tried it with google seo plugin but it turns into 404 for all post urls then.
I need to have the trailing slash at the end because our blog has it and we need tom match the url scheme.
You're going to need to edit the .htaccess file to do that.
I added the code generated by google seo plugin to add the trailing slash but it did not work. So what do i do now?

When i try to add trailing slash all post and forum urls turn into 404
All right. Bump

If i force trailing slash mybb turns into a big 404 for all post urls. what to do?
up again
Show your whole .htaccess file.
here it is
# Some hosts require RewriteBase to make RewriteRules work.
RewriteBase /cyberhub/

RewriteEngine on
RewriteRule ^([^&]*)&(.*)$ https://www.braindirector.com/cyberhub/$1?$2 [L,QSA,R=301]

RewriteCond %{HTTP_HOST} ^braindirector.com$
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/cyberhub/$1 [R=301,L]

# Google SEO 404:
ErrorDocument 404 /cyberhub/misc.php?google_seo_error=404

# Google SEO Sitemap:
RewriteRule ^sitemap\-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]

# Google SEO URL Forums:
RewriteRule ^forum\-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]

# Google SEO URL Threads:
RewriteRule ^thread\-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

# Google SEO URL Announcements:
RewriteRule ^announcement\-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]

# Google SEO URL Users:
RewriteRule ^user\-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]

# Google SEO URL Calendars:
RewriteRule ^calendar\-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]

# Google SEO URL Events:
RewriteRule ^event\-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]

And you have already tested that with trailing slash urls return 404 error. so what do we do?

up up
(2014-10-31, 03:17 PM)helper4u Wrote: [ -> ]i want them to end with a trailing slash

I strongly advise against it, that / will cause you a ton of problems for absolutely no benefit. See the Google SEO documentation, regarding virtual directory structures. It should give you some ideas.

You'd have to add the trailing / to each scheme in the URL settings; and change the rewrite rules ($ to /?$ e.g. ^forum\-([^./]+)/?$).
Well With Due Respect Mr frostschutz
There are two main reasons behind me wanting to add a trailing slash.
1. My blog uses the trailing slash at the end of the urls.
2.Google's Matt Cutt uses the same structure. All urls end with a trailing slash.
3.Some of the most famous blogs like wpbeginner and hongkiat are also using the same structure.
The things that worries me about not having a trailing slash is that it breaks the url scheme for my website as blog posts have a trailing slash.
And i think these two url schemes together may negatively impact my SEO. so i want to stick to one format and when i try to decide which one to use i see Matt Cutt and other famous sites using a trailing slash.
I might give up on this if you can convince me that it is not not going to impact my seo.
Or you can just guide me step by step how do i force a trailing slash Smile

You have my .htacess file up there, you can modify it (because you know how to) and i can upload it (because i have access)
And we can mark this post as solved Smile

Another thing behind wanting this change is this that we are a kind of authority site and we rank for many keywords in different niches. We have the ability to write about any topic and to get ranked for that. For example talking of mybb we rank number 1# for
Mybb Raputation Cleaner Plugin
and many other such terms
We also rank number 1 for
Memory Techniques For Bankers
and many other such terms.
Probably the authority factor and we have a strong base of contributors.
I hope it is clear what i am trying to say here.
I am thinking of the future. If using two different schemes is going to cause a problem, we might be able to deal with it now but in future when things get even better for us, we might not be able to make the switch.
We have one blog, three forums and one gamings section under this domain so yeah it is a big one and that is why i am concerned about it.
up up up

can anyone please edit my .htacess file and include a trailing slash at the end of the post urls?

one question. Will adding the .html instead of / will do the same thing? or is there any difference?