PDA

View Full Version : Can change FORUMS in vBulletin URL to CATEGORY?


webmastersun
05-04-2016, 07:38 PM
Hello,

Do you know how to change just a word in URL from forums to Category for forumdisplay (this is url when viewing forum display)?

of course I need to change word forums to category without using url redirection

for example:

example.com/forums/23-Content-Management

to

example.com/category/23-Content-Management

I tried to change in .htaccess file but it didn't work.

Any suggestions?

Thanks

greigeh
05-04-2016, 07:44 PM
Isn't this because the actual directory of your vB is in '/forums' try change the directory name?

webmastersun
05-04-2016, 07:54 PM
Isn't this because the actual directory of your vB is in '/forums' try change the directory name?

You might not read my question :)

I ran my forum at my domain (don't have any sub folders here) , i.e : example.com is forum

the word that I want to change, is for forumdisplay.

this is a URL for forumdisplay

http://www.webmastersun.com/forums/95-Web-Hosting

that I want to change to

http://www.webmastersun.com/category/95-Web-Hosting



Thanks

greigeh
05-04-2016, 09:18 PM
You might not read my question :)

I ran my forum at my domain (don't have any sub folders here) , i.e : example.com is forum

the word that I want to change, is for forumdisplay.

this is a URL for forumdisplay

http://www.webmastersun.com/forums/95-Web-Hosting

that I want to change to

http://www.webmastersun.com/category/95-Web-Hosting



Thanks


Do you have vBSEO or something similar installed?

CAG CheechDogg
05-04-2016, 10:16 PM
This might be what you are looking for ....


This feature requires that the "Always use Forum URL as Base Path" be set to yes.

This will override the main Forum URL setting for forum pages to allow the forum pages to be accessed from a different directory than the rest of vBulletin. This value can either be an absolute URL in which case it fully overrides the Forum URL or it can be a relative URL, in which case it is appended to Forum URL.

For example, if vBulletin is located at http://example.com/vbulletin then entering a value of "forum" will result in the forum being located at http://example.com/vbulletin/forum. A value of "http://www.example.com/forum" will result in the forum being located at http://www.example.com/forum. All vBulletin URLs must have the same host name.

In addition to setting the Forum Component URL, you will need to take the following steps in order for the forum to work in the new location.

If you are locating the forum in a directory other than a direct subdirectory of the vBulletin directory (http://example.com/vbulletin/forum in the above example), edit forum/vb_dir.php in the do_not_upload directory of your download package to set the vBulletin install directory. Instructions are given in that file.
Upload the forum files directory from the do_not_upload to the directory you want the forum to be located in. If you want the forum to be in http://example.com/vbulletin/myforum, create a subdirectory in your vBulletin directory called myforum and upload the forum files there.
If you are using rewrite friendly URLs, you will need to copy the .htaccess file from do_not_upload/rewrite/apache2/forum to the stub directory before uploading.
If you are using a different domain, such as forum.example.com versus www.example.com then you will need a crossdomain.xml file for the asset manager flash upload. Create a file called "crossdomain.xml" and place it in your forum subdirectory with the following contents modified to suit your domain.
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
<allow-access-from domain="*.example.com"/>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-http-request-headers-from domain="*.example.com" headers="*" secure="true"/>
</cross-domain-policy>

If the cookie path option is set for the site, it needs to be general enough to include all vBulletin URLs. For example, if vBulletin is located at www.host.com/mysite/vbulletin but the forum is located at www.mysite.com/mysite/forum then a cookie path of "mysite" will work, but a cookie path of "mysite/vbulletin" will not work because the cookies will not be sent to pages in the mysite/forum directory.

webmastersun
05-04-2016, 10:38 PM
Do you have vBSEO or something similar installed?

No I don't want to use any addons in this case like vBseo or dbseo.

I want to use original friendly url mod from vBulletin but just change forums to category for forumdisplay.php

TheLastSuperman
05-05-2016, 12:40 AM
I tried to change in .htaccess file but it didn't work.

What code did you use? Please post it ;).

You can try adding this to .htaccess file:

RewriteCond %{THE_REQUEST} ^GET\ /forums/
RewriteRule ^forums/(.*) /category/$1 [L,R=301]

webmastersun
05-05-2016, 12:56 AM
What code did you use? Please post it ;).

You can try adding this to .htaccess file:

RewriteCond %{THE_REQUEST} ^GET\ /forums/
RewriteRule ^forums/(.*) /category/$1 [L,R=301]

I tried your code but it didn't work

or it redirected to /category/ but die in 1 music note :D

here's my htaccess code, it is code from vbulletin

# Options -MultiViews

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]


Honestly i don't want url redirections by htaccess, which I need is, when hover on forums (forumdisplay) then it was ..../category/...


Thanks

TheLastSuperman
05-05-2016, 01:22 AM
I tried your code but it didn't work

or it redirected to /category/ but die in 1 music note :D

here's my htaccess code, it is code from vbulletin

# Options -MultiViews

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]


Honestly i don't want url redirections by htaccess, which I need is, when hover on forums (forumdisplay) then it was ..../category/...


Thanks

Erm not sure if that will work then w/o something like DBSEO. Reason is look at your code above ^ ... see the RewriteRule ^forums/.* forumdisplay.php [QSA] part of it? That tells it to rewrite forumdisplay.php in url to /forums/ and this is why many sites have forum/forums/ in the url which many do not like (as it looks quite silly honestly) so the only way to change it from what I recall w/o a mod like dbseo... would be to change that actual line.

Example:

Change this:
RewriteRule ^forums/.* forumdisplay.php [QSA]

TO:
RewriteRule ^category/.* forumdisplay.php [QSA]

However after checking please note the url, ensure this is a change you wish to make and that it's what you were originally asking for. The reason why mods like dbseo exist is because you can't do everything with rewrites in normal mod-rewrite friendly url setting and .htaccess, you can come pretty darn close but sometimes a mod/plugin is required and unless someone chimes in soon and puts me in my place I'll stick to my guns in my statement :p.

webmastersun
05-05-2016, 01:46 AM
I don't install vbseo or dbseo on my forum :)

see the RewriteRule ^forums/.* forumdisplay.php [QSA] part of it?
it is the code from vbulletin

RewriteRule ^forums/.* forumdisplay.php [QSA]
TO:
Code:
RewriteRule ^category/.* forumdisplay.php [QSA]

I tried this in the past and today but it didn't work. I think it needs to change in some vbulletin files

The URL is in the reply #3 https://vborg.vbsupport.ru/showpost.php?p=2570147&postcount=3

It is default from vbulletin with Mod Rewrite Friendly URLs enabled.