1 (edited by zetrader 2019-02-08 18:59)

Topic: Is it easy to change the "topic" word in url ?

Hello, with the "file based fancy" url schema, if i want to change to change the "topic" word with another word ("t" to be shorter or other word), is it easy to do it? How can i do it?
For example, change urls : myforum.com/topicxx-my-subject.html to myforum.com/txx-my-subject.html (where xx is the number of the topic) ?

EDIT : in /include/url/File_based_(fancy)/forum_urls.php if i change :

'topic'                            =>    'topic$1-$2.html',

to :

'topic'                            =>    't$1-$2.html',

I get the urls of the topics changed from topicxx to txx, but when i click on a topic (showing a txx url) i get a 404 error.

Thanks,

Pierre

Re: Is it easy to change the "topic" word in url ?

rewrite_rules.php?

'/^(forum|topic)[\/_-]?([0-9]+).*[\/_-]p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'    

create new line

    '/^t[\/_-]?([0-9]+).*[\/_-]p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'                                            =>    'viewtopic.php?id=$1&p=$3',
Parserus, UserAgentAnalyzer.
I speak only Russian  :P

Re: Is it easy to change the "topic" word in url ?

I've tried to add this new line after the first one you quoted.
Thank you for trying, but it didn't change anything : urls are the same (using topic word), i created post to see if it's only with new post, same thing, it generates with topic url.

Then i tried to put this new line instead of the first one you quoted : still the same (urls using topic word, even creating new topics).
So i put back the original lines.

Re: Is it easy to change the "topic" word in url ?

+ add

    '/^t[\/_-]?([0-9]+).*(\.html?|\/)?$/i'                                                                        =>    'viewtopic.php?id=$1',
Parserus, UserAgentAnalyzer.
I speak only Russian  :P