Setting the WordPress and Blog URLs (6 posts)

  1. davidcollantes
    Posted 7 years ago #

    This applies to all versions of WP. Under General Settings -> WordPress Address (URL) and Blog Address (URL), I want it to be:


    Notice the trailing slash. But even if I put the slash, when I save changes, they both get removed. Why? I need them.

  2. erikreagan
    Posted 7 years ago #

    Why do you need the slash?

  3. davidcollantes
    Posted 7 years ago #

    I use a plugin named alt-openid. It sets a variable named SetTrustRoot to get_bloginfo('url'). If works fine, but the URL at the server gets written http://domain.com and not http://domain.com/.

    Being the purist I am, I don't like it. I advocate the trailing slash, specially when referring to a directory.

    I have tricked the plugin to do:

    $mysiteurl = get_bloginfo('url').'/';

    And now does what I want, but wondered why WP is stripping the '/' when purposely set.

  4. Ivovic
    Posted 7 years ago #

    aha... so OCD, then.

    people don't type domain.com/ because the / is superfluous, you only think it looks better because of the protocol prefix.

    ultimately, what you're chasing isn't the convention, the convention doesn't include a trailing slash to offset the aesthetics of the http:// prefix.

    I understand your desire to keep what's input, but templates are built based on functions which pull that value. If your site has a trailing slash and mine does not - template's that use the site address variable would either have too many slashes or not enough.

  5. davidcollantes
    Posted 7 years ago #

    Ivovic, there are people pro and con the trailing slash. My approach, if it is root (/) or a directory, it should end on /. If it is a file, of course not. Although I would rather use http://domain.com/about/ (with an index under that directory) than http://domain.com/about.ext

  6. Ivovic
    Posted 7 years ago #

    so would I... not sure what your point is really, I've explained why the trailing slash should be either dropped or added, for uniformity so that theme authors can rely on the output of bloginfo() and related functions.

    the rest is all a matter of personal preference... but someone needed to draw the line, and unfortunately you fell on the other side of it.

    Having said that, my blog shows a trailing slash in the address bar on the index page, despite there being none in the options.

Topic Closed

This topic has been closed to new replies.

About this Topic