Jump to content

Friendly URL Suggestion (furlTemplate.php)


chopin

Recommended Posts

I suggest allowing for the following format, when it comes to editing furlTemplate.php:

www.example.com/topicdirectory(topicnumber)/topic-name/ or...
www.example.com/topicdirectory/topicnumber/topic-name/

As of now, furlTemplate does not allow us to remove the dash in friendly urls which precedes the topic name. Please see my topic about this here.

I personally find that a friendly URL looks much better when the topic number does not separate the topic name with a dash. My desired format would look like this:

www.example.com/t54/topic-name1/
www.example.com/f2/forum-name1/

This leaves for the URL topic title in its own directory, which not only looks neater, but when searching in Google, the highlighted keywords are in its own directory. Whether or not this affects SEO, is not my main concern though, I really am just looking for neatness.

I hope this can be considered as a revision in the next IPB update! Thanks for listening.

Link to comment
Share on other sites


Not important suggestion. Everybody can change their own furlTemplate as want. I made it.



He wants to have it like: /forums/t123/name-of-topic-here

But that won't work. It has to have the dash after the topic number or it won't work. So it's kind of important for those who want to change the format.
Link to comment
Share on other sites


He wants to have it like: /forums/t123/name-of-topic-here



But that won't work. It has to have the dash after the topic number or it won't work. So it's kind of important for those who want to change the format.




:blink: What on Earth are you talking about?

" alt="" class="ipsImage" width="1000px" height="729px">

'showforum' => array( 'app' => 'forums', 'allowRedirect' => 1, 'out' => array( '#showforum=(.+?)(&|$)#i', 'f$1/#{__title__}/$2' ), 'in' => array( 'regex' => "#/f(d+?)/#i", 'matches' => array( array( 'showforum', '$1' ) ) ) ),





The furl templates use regular expressions... you can pretty much make them what you want.

Link to comment
Share on other sites

It "works" as long as you don't use 301's to redirect. If you use 301's however, it goes into a never ending loop. But problems occur when you try installing apps that also use FURL. Now I can't use any apps, and they redirect to my forum home because my format is www.example.com/t#/topic-name/. Not sure what to do other than wait for a fix. I don't want the number included in the topic url, I suppose it is just personal preference, and to me, the looks of a url is important.

Thus, in my case at least, I feel the FURL template is a bit limiting.

Link to comment
Share on other sites

While I may be mistaken, I cannot think why that would be the case, and was unable to reproduce that.

The code I posted it working fine for me (see the screenshot). Once you've made that change, you'll just need to rebuild the furl cache (just go to the ACP and you should be alerted to it).
If it doesn't work, feel free to drop me a PM and I can take a look.

Link to comment
Share on other sites

Just tried this on my dev board:

	'showtopic'     => array( 'app'		      => 'forums',

							  'allowRedirect' => 1,

							  'out'           => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1/#{__title__}/$2' ),

							  'in'            => array( 'regex'   => "#/topic/(d+?)/#i",

												        'matches' => array( array( 'showtopic', '$1' ) ) ) ),



and it works fine

Link to comment
Share on other sites

Try enabling mod rewrite, to eliminate index.php? by going here:

tools and settings --> systems settings --> Use .htaccess mod_rewrite (set to yes, and apply changes to your htaccess file accordingly)

Next, under the same setting, try redirecting your urls by heading to "Incorrect Permalink Handling" and choosing "redirect to correct link with a 301 header"

Do you still get success with those settings?

Link to comment
Share on other sites


While I may be mistaken, I cannot think why that would be the case, and was unable to reproduce that.



The code I posted it working fine for me (see the screenshot). Once you've made that change, you'll just need to rebuild the furl cache (just go to the ACP and you should be alerted to it).


If it doesn't work, feel free to drop me a PM and I can take a look.



I had rebuilt the furl cache, as I think it'd just be confused about where to go otherwise and simply go to the main board index.

I just now tried it with "Incorrect Permalink Handling" set to "Do Nothing" and that fixed the issue. A bug perhaps?
Link to comment
Share on other sites


I wouldn't say a bug since you're modifying the code, but I'll see if that can be changed.



It only happens when the setting is set to "Redirect to correct link with a '301' header."

When setting it to redirect the old ?showxxxx=## to the new fURL format, and doing the 301 header, that works fine. It's only when the other setting is done.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...