• Hi guys,

    I’ve installed WordPress in a sub-directory called /blog/. It works fine, and so far I’ve created a navbar and some Pages for Home, About, etc.

    Now, what I want to do is send requests for https://www.mysite.com/ to the blog home Page I created, e.g. https://mysite.com/blog/home/. Optionally I’d also like to send requests for https://www.mysite.com/about.htm to https://www.mysite.com/blog/about/. There are various reasons for this, but the most important one is the home page obviously.

    I now have the following .htaccess file in the root directory:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^$ /blog/home/
    RewriteRule ^about.htm$ /blog/about/

    ‘Interestingly’ enough, the home page redirection lands on /blog/(index.php) and displays the posts. The about page lands on the blog 404 page.

    Any idea what I’m doing wrong here?!? I’m totally lost. I thought it’d just be a simple thing. Guess not… ??

    For performance reasons I only want to use the RewriteRule method (versus a php redirect or something). If I use the [R] option it does work, BUT is obviously far from ideal as it requires unnecessary extra communications, etc.

    Looking forward to any replies/ideas/help/etc! ??

    Kind regards,
    Koek

Viewing 1 replies (of 1 total)
  • Thread Starter koek

    (@koek)

    P.S. ??

    I changed the .htaccess file slightly to:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^$ /blog/index.php?page_id=6
    RewriteRule ^about.htm$ /blog/index.php?page_id=2

    page_id=6 => home page
    page_id=2 => about page

    Note that the home page redirection (e.g. https://www.mysite.com/) now works, but the about page still gives a 404 error. I don’t understand this, why does one work, and not the other?

    Any idea what I’m (still) doing wrong?

    Kind regards,
    Koek

Viewing 1 replies (of 1 total)
  • The topic ‘.htaccess for WP in /blog/’ is closed to new replies.