.html extensions to static wp pages LOOSING the trailing slash CORRECTLY on blogindex

Discussion in 'WordPress' started by jeanmichel, Oct 18, 2010.

  1. #1
    As the title states, I'm having problems implementing .html file extensions to wordpress static pages. Not to the extent that you would imagine.

    I have the urls of the static pages set perfectly, this has been done with a nifty plug-in (quite commonly used).

    It does the job until........

    You have designated a static page as your home page and the blog index is set to a page of your preference e.g. example.com/ displays a page in wordpress you've created and example.com/articles/ displays all your posts.

    Now that the plugin has re-written the url's, so you end up with a structure as such;

    example.com/ ---> home page
    example.com/staticpage.html ---> static page
    example.com/articles.html/ ---> blog index !!!!!!! <- (madness trailing slash)
    example.com/post.html ---> blog post

    WTF? why has wordpress decided to add a trailing slash to the static page you designate as being the blog posts index? and does anyone know a workaround?

    I've tried .htaccess mods but end up with a neverending re-direct, a multitude of plugins to remove the trailing slashes from pages, all kinds of crazy permalink structures but none seem to be of any use.

    current permalink structure:

    /news/%postname%-%post_id%.html

    the plug-ins i have used are;

    html-on-pages
    Permalink Trailing Slash Fixer

    Nothing else enabled as to solve this issue first-lots of comments on the plugin authors blog regarding this issue but nobody seems to have come up with a fix?

    Cheers.
     
    jeanmichel, Oct 18, 2010 IP
  2. jeanmichel

    jeanmichel Peon

    Messages:
    29
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    no worries to all that have read this post-i have corrected the problem but thought it may be useful for people trying to correct this problem to know how i solved the issue.

    Download the Smart Trailing Slash plugin.

    This removes all trailing slashes from urls-but as long as you have the Permalink Trailing Slash Fixer plugin installed your category base urls will maintain structure.

    For those of you running All in one SEO pack, an adjustment is required to solve the canonical tag issue- edit the plugin file named aioseop.class.php inside the All in one SEO pack folder.

    Look around line 750 and place an if statement regarding your blog post index page to display the url without the trailing slash.

    if($url == 'http://www.example.com/articles.html/') {
    echo "<link rel=\"canonical\" href=\"http://www.example.com/articles.html\" />\n"; } else { !!the remainer of the function!! }
     
    jeanmichel, Oct 19, 2010 IP