Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi rana2u

    Check your .htaccess file in your home directory. You may have the following line:

    RewriteBase /

    This line will forces a trailing slash on URLs.

    If you’re running the WordPress SEO by Yoast plugin, check the SEO > Permalinks setting screen, as there’s an option there too, to force the trailing slash. You’ll want to untick that option.

    Let me know how you go!

    Thread Starter rana2u

    (@rana2u)

    Yes .htaccwss has the line RewriteBase /
    Is that what’s causing a redirect from http://www.pressrun.net/weblog to http://www.pressrun.net/weblog?
    How do I remove the redirect?
    The URLs of my blog posts don’t end with a trailing slash. My blog post’URLs are like this:
    http://www.pressrun.net/weblog/2014/08/the-poems-of-john-betjeman.html
    They end in .html
    I kept that format because I migrated from Typepad.
    So what should I do to remove the redirect from http://www.pressrun.net/weblog to http://www.pressrun.net/weblog?
    Do I have to rewrite .htaccess. How? What should I write there?
    Please help. Thank you.

    Make a backup of your current .htaccess file, so you can roll back if you need to. Next, open your .htacccess in a text editor and remove the line

    RewriteBase /

    Make sure you leave the other lines.

    See if that fixes the issue and let me know how you go.

    Thread Starter rana2u

    (@rana2u)

    This is what I see in the file:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /weblog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /weblog/index.php [L]
    </IfModule>
    
    # END WordPress

    Which part do I take out? Do I just take out RewriteBase / and change it to

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    weblog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /weblog/index.php [L]
    </IfModule>

    Hey rana2u

    Check out your permalink settings, located in your WordPress admin area under Settings > Permalinks.

    Have a look at the Custom Structure and you’ll probably find it has a slash right at the end of the url structure. If you remove that last slash, it should fix that problem.

    Let me know if that fixes it for you.

    Thread Starter rana2u

    (@rana2u)

    There’s no slash at the end of the URL structure. Thank you.

    Hi again rana2u

    Thanks for checking that.

    The way I understand it, there’s a few ways for those redirects to happen. One is through the WordPress settings for Permalinks, and another is in the .htaccess. I’m not comfortable making suggestions for you to change your .htaccess seeing as ours are configured differently. I don’t have any WordPress installations in subdirectories to test it out at the moment.

    I’m not sure having the redirect with the trailing slash is doing your site any harm. There’s an interesting article (http://tommcfarlin.com/trailing-slash-in-wordpress/) explaining why it’s good to have the slash.

    Apologies if I can’t help you further.

    Thread Starter rana2u

    (@rana2u)

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Redirects’ is closed to new replies.