WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] permalink URL with one letter redirect (4 posts)

  1. Kwayy Infotech
    Member
    Posted 3 years ago #

    Hello,

    I don't know this is core feature or a bug so please guide me.

    I have setup WordPress 3.1.3 on my localhost. So I can access it from:
    http://localhost/wordpress/

    I have enabled permalink and the custom structure is "/%postname%/"

    The problem is when I go to this URL:
    http://localhost/wordpress/s
    .. than it redirect to :
    http://localhost/wordpress/sample-page/

    Also, when I go to this URL:
    http://localhost/wordpress/b
    .. than it redirect to :
    http://localhost/wordpress/blog/

    I want to get 404 error when I go to http://localhost/wordpress/s http://localhost/wordpress/b page. How can I do this?

    More Information:
    - I have created a new page with title "Homepage" and set it at homepage from Admin>Settings>Reading.
    - I have created a new page with title "Blog" and and set it as Posts Page at Admin>Settings>Reading.
    - I haven't created any page with slug "s" or "b".

    Help me on this.

    Thanks
    Bimal

  2. Kwayy Infotech
    Member
    Posted 3 years ago #

    Also this is fresh WordPress install. I haven't installed any plugin.

  3. Darrell Schauss
    Member
    Posted 3 years ago #

    This is default functionality for canonical URLs.

    Try this in your functions.php but you will also lose the benefits of automatically redirecting URLs if you change the URL of a post.
    remove_filter('template_redirect', 'redirect_canonical');

    There is also a redirect_guess_404_permalink but it doesn't seem to be pluggable with the remove_filter. There is a work around listed here as well.
    http://core.trac.wordpress.org/ticket/16557

    function remove_redirect_guess_404_permalink( $redirect_url ) {
        if ( is_404() )
            return false;
        return $redirect_url;
    }
    add_filter( 'redirect_canonical', 'remove_redirect_guess_404_permalink' );
  4. Kwayy Infotech
    Member
    Posted 3 years ago #

    It works perfectly.
    Thank you very much.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.