The MU forums have moved to WordPress.org

How to avoid 'blog' word into permalinks URLs (17 posts)

  1. guarri-man
    Member
    Posted 17 years ago #

    Hi.

    Using WordPress MU v1.1.1, I'd like to avoid 'blog' word into permalinks URLs.

    I was told that it requires that my installation code must be hacked. Did anybody do it before? Thank you veru much.

  2. lunabyte
    Member
    Posted 17 years ago #

    As I mentioned before, it only affects blog_id 1.

    And yes, again, you will have to modify core files to remove it.

    And yes, I've done it.

    Grep through wp-admin, for "blog/".

    You'll also have to edit the main blog in site admin -> blogs, to remove it from one of the fields.

  3. pixline
    Member
    Posted 17 years ago #

    1) wp-admin/option-permalink.php
    replace all "/blog" with your tag, say "/news", with your code editor. please note the slash :-)

    2) wpmu-settings.php
    line 90 (in wpmu 1.1.1) : add your tag to the array ('news'), without slash.

    3) in database, into wp_1_options, change permalink_structure once, then visit admin option panel to regenerate permalinks and htaccess rules

  4. stirlyn
    Member
    Posted 17 years ago #

    Hello, I would like to ask a further question re this topic.
    Pixline's reply was good but I have the need to remove the word 'blog' completely and not replace it by something else as this will affect existing listings in search engines and with other links on sites.

    I followed pixline's suggestions (minus) the replacement but found I was always being redirected to the signup page with the link title forming part of the new subdomain as a suggestion.

    Can anyone suggest a way to get rid of 'blog' completely from the main site blog. This domain will only be blogs and there is no need for me to use pre-existing subdomains.

    Any further suggestions would be welcomed
    Thanks

  5. pixline
    Member
    Posted 16 years ago #

    I think that may be impossible to get rid of it, because the whole wpmu structure - as far as I see - relies on that url segment as argument in choosing which blog or which site is requested.

    Maybe someone can look the code deeper than me and make a patch, but actually I can't find a way to work that out, sorry.

  6. lunabyte
    Member
    Posted 16 years ago #

    "I think that may be impossible to get rid of it, because the whole wpmu structure - as far as I see - relies on that url segment as argument in choosing which blog or which site is requested."

    Better look at my blog then, because it "is" quite possible.

  7. BjornW
    Member
    Posted 16 years ago #

    Lunabyte,

    Could you please tell us more into detail about how you achieved this? I'm also very curious of how you plan to handle future WP MU updates.

  8. jshare
    Member
    Posted 16 years ago #

    guarri-man: assuming you've already launched, I would also suggest setting up a redirect rule so that search engines and people's bookmarks continue finding your content

  9. lunabyte
    Member
    Posted 16 years ago #

    How did I do it? Did you read the thread from the start?

    Handling updates? Do what I do with any other edit I've needed to make for my own purposes...

    I write it down, keep track, and re-modify as needed.

  10. BjornW
    Member
    Posted 16 years ago #

    Lunabyte,

    Yes, I've read the thread from the start. Changing the core files by removing or replacing the word blog seems like a nice solution if the changes are only necessary for your own purposes. I was hoping you might have found an easy way to make the changes and be 'future compatible with WP MU. Apperently not. Thanks anyway.

  11. drmike
    Member
    Posted 16 years ago #

    Most of us are updating every day instead of waiting for version updates.

    If you do any system admining, this is typical.

  12. lunabyte
    Member
    Posted 16 years ago #

    Not to mention, it's hard coded into the admin area. It isn't something trivial in terms of how to fix it.

    The only way to fix something hard coded, is to recode it.

  13. ladynada
    Member
    Posted 16 years ago #

    I still need help with this problem:

    "always being redirected to the signup page with the link title forming part of the new subdomain as a suggestion."

    Lunabyte can you tell us exactly how to make permalinks work for the main blog? I do not mind editing core files at all.

    all my other blogs are fine, only the main blog does not work for tags, for paging

    thanks for any help,
    nada

  14. pumpkinslayer
    Member
    Posted 16 years ago #

    The only reason (as I see it) for the hardcoding is that if you run a subdirectory install then the "blog" directory identifies posts as being on the main blog (blog #1) and not one of the other blogs.

    I did the exact suggestion mentioned here for my vhost install (removing the reference to /blog).

  15. lunabyte
    Member
    Posted 16 years ago #

    That's the only reason I see as well.

    And yeah, removing all references to /blog is the way to go for a subdomain install. Well, unless you want all your posts under /blog, but a lot of people don't.

  16. ladynada
    Member
    Posted 16 years ago #

    Hello everyone,
    My setup is a subdirectory install and the fix I put in today and am testing now was aided by a message that described how to stop MU from sending people to the login page with a tag name already entered as a new blog.

    In that section of wpmu-settings.php, they simply edited out the commands to send the user to the login page.

    Since that location in the code is exactly where my bar urls for tagged pages was going, I interceded there with some code to make a log of what the original url request was, and then manipulated the strings and added the missing index.php, and now it works.

    The problem was originally this section:

    if( defined( "WP_INSTALLING" ) == false ) {
    	if( $current_site && $current_blog == null ) {
    		header( "Location: http://{$current_site->domain}{$current_site->path}wp-signup.php?new=" . urlencode( $blogname ) );
    		die();
    	}

    nada

  17. pschena
    Member
    Posted 15 years ago #

    @pixline - you made this easy. Thanks!

About this Topic

  • Started 17 years ago by guarri-man
  • Latest reply from pschena