WordPress.org

Ready to get started?Download WordPress

Forums

Blog's main page in domain.com/blog - not domain.com/blog/ (3 posts)

  1. tezeusz
    Member
    Posted 4 years ago #

    Hello everyone,

    I'm new to WordPress, I only started one for my own needs.

    My website - innestudio.eu - has URIs without trailing slash.

    WP files are placed in 'wp' dir and there are rewrites (in htaccess) so the blog is seen on innestudio.pl/blog

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^blog$ wp/index.php [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^blog/(.+)$ wp/index.php [L]

    There is just a problem with the blog's main page. mod_rewrite redirects 'blog/' to 'blog' as all other URIs in the whole site which are not dirs.

    RewriteCond %{REQUEST_URI} (.*)/$
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.+)/$ /$1 [R=301,QSA,L]

    But then again php of WP redirects it 'blog' back to 'blog/' and too many redirects error appears.
    All other blog pages work corretly, i.e. http://innestudio.eu/blog/2010

    Can you help me how to tell WP: "Your main page is in 'innestudio.eu/blog'. don't redirect it to 'innestudio.eu/blog/'"?
    I would like it to be without the slash in the end like all other pages in the site.

    Best regards,
    Marcin

  2. tezeusz
    Member
    Posted 4 years ago #

    I have found a temporatory way for this, which is:

    remove_filter('template_redirect','redirect_canonical');

    However, for seo reasons, it is not good to have the redirection to canonical addresses off, so if someone has an idea how to solve the blog's main page issue URI, please help me.

  3. Scott Chandler
    Member
    Posted 3 years ago #

    Bumping, I would also like to know this.

Topic Closed

This topic has been closed to new replies.

About this Topic