Allowing Longer URLs for Permalinks

15th Jan 2006 stk

Dawn (v0.9.1.0)

This method was tested specifically on a "Dawn" installation. It it anticipated that it will work in any of the 0.9 series installations, but no other versions have been tested. IF you are attempting to do this in another version, please email us and let us know of your success or any problems you encounter (We can then update this post with that valuable information). Thank you.

For Dawn, there are three things you need to change ...

  1. Modify your b2evolution database. Specifically, the evo_posts table and the post_urltitle field. Do this using myphpAdmin by changing the structure of the field from varchar 50 to varchar 250 (how many characters it allows).

  2. Allow more characters in the backoffice EDIT form for "URL Title". To do this step edit your /admin/_edit_form.php. Around line 250 or so, you find the following and bump up maxlength value to 250, as highlighted, below:


    <input type="text" name="post_urltitle" id="post_urltitle" value="<?php echo format_to_output( $post_urltitle, 'htmlattr' ); ?>" size="40" maxlength="<span style="background-color:#ffa"><strong>250</strong></span>" tabindex="20" />
  3. Increase the allowed, overall URL length. One would think doing (1) and (2) would be all you need, but it's not. The overall URL (which includes the http://, the directory path AND the title) has it's length limited when the URL is validated. One needs to increase this value.

    To do this, edit b2evocore/_functions_bposts.php. Look around line 314 for the following and change the value from 100 to 500, as highlighted below:


    $urlbase substr$matches[1], 0, <strong><span style="background-color:#ffa">500</strong></span> );

BOOM ... you now have SUPER LONG URLS

  1. Question & No-hack Options
  2. Dawn (v0.9.1.0) or Earlier
  3. Phoenix (v1.6 Alpha) or Newer
  4. Longer URLs & Page Ranking

No feedback yet

Comments are closed for this post.