Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Wordpress Blog in Vanilla install:Posts say Page Not Found

Hello,

I have vanilla installed in my root folder mysite/
I have now installed wordpress in mysite/blog

I am able to access mysite/blog and mysite/blog/wp-admin

However, when I write a post "Hello World", and its URL is mysite/blog/hello-world, I am not able to access it. When I click on the title of my post, it shows Vanilla's classical Page not found error.

Can someone help me with this?

Comments

  • No replies yet? or Have I not been able to put my question properly?

  • ShadowdareShadowdare r_j MVP
    edited March 2013

    The rewrite rules for the permalinks in WordPress is probably not configured correctly. Make sure that the .htaccess file in WordPress is set up correctly.

    Add Pages to Vanilla with the Basic Pages app

  • well naturally.

    it will route /blog/something-virtual to index.php?p=/blog/something-virtual

    you will have to configure your .htaccess files to route correctly.

    in /.htaccess right before

    RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]

    put

    RewriteCond %{REQUEST_URI} !^blog(/.*)?$

    then try.

    You might need to set the RewriteBase in /blog/.htaccess or comment the line out.

    grep is your friend.

  • @Shadowdare Thanks for the reply :-)
    There is no .htaccess file in my wordpress folder /blog. (I just created one.Its currently blank)
    @x00 Currently my .htaccess file in / looks like:-

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)? index.php\?p=$1 [QSA,L]

    I made it to:-
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^blog(/.)?$
    RewriteRule ^(.
    )? index.php\?p=$1 [QSA,L]

    I am able to access vanilla normally, but the /blog/hello-world still shows the vanilla page not found. Can you tell me what changes/additions do I need to make to the /blog/.htaccess?

  • neyawnneyawn New
    edited March 2013

    Okay, just describing the situation at my end:-

    My /.htaccess file looks like:-
    RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^blog(/.*)?$ RewriteRule ^(.*)? index.php\?p=$1 [QSA,L]

    My /blog/.htaccess looks like:-

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

    1. My vanilla forum ( in root directory) works fine.
    2. My wordpress index.php (in /blog) works fine
    3. My wordpress posts redirect to vanilla
      e.g : mysite/blog/hello-world shows the URL "mysite/blog/hello-world" but renders mysite/

    What am I doing wrong?
    @shadowdare I created a /blog/.htaccess file as described above.

  • can you change

    RewriteRule . /index.php [L]

    to

    RewriteRule . /blog/index.php [L]

    grep is your friend.

  • You can also do

    RewriteRule . index.php [L]

    RewriteRule . index.php [L] is wrong becuase / is your root so you are directing it back to /index.php not /blog/index.php

    Because you are using RewriteBase, then you can leave of the leading slash and it is relative. So blog would attempt /blog/blog

    grep is your friend.

  • @x00 Works perfect. Thanks a ton! :-)

  • Sharing The final solution below:-
    mysite/.htaccess file

    RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^blog(/.*)?$ RewriteRule ^(.*)? index.php\?p=$1 [QSA,L]

    mysite/blog/.htaccess file
    `# BEGIN WordPress

    RewriteEngine On
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]

    END WordPress`

    Thanks again, both of you :-)

  • @neyawn said:
    Sharing The final solution below:-
    mysite/.htaccess file
    mysite/.htaccess

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^blog(/.*)?$
    RewriteRule ^(.*)? index.php\?p=$1 [QSA,L]
    

    mysite/blog/.htaccess file

    # BEGIN WordPress
    
    RewriteEngine On
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    
    # END WordPress
    

    grep is your friend.

Sign In or Register to comment.