• Resolved mokidad

    (@mokidad)


    I installed wordpress in a subdirectory. Then moved it to the root to make links prettier. My main static site is done in iWeb (*everybody calm down*) so I have an index.html that redirects to Home.html. WordPress works fine for normal use, but there are a few things that are broken.

    Search and Preview.
    Every time a link is sent to my site with a question mark parameter:
    http://mokidocavaliers.com/?p=112
    it redirects to the root and goes to the home page. This breaks searching (?search=blah) and preview (?p=112&preview=true)

    Here is my .htaccess:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mokido.net [NC]
    RewriteRule ^(.*)$ http://mokidocavaliers.com/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^www.mokido.net [NC]
    RewriteRule ^(.*)$ http://mokidocavaliers.com/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^www.mokidocavaliers.com [NC]
    RewriteRule ^(.*)$ http://mokidocavaliers.com/$1 [R=301,L]
    Redirect 301 /Blog/ http://mokidocavaliers.com/blog/
    
    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    If you have WP in a subfolder, then you cannot have this

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

    See even when you have WP in a folder but ACTING like it’s in root (i.e. domain.com but installed in domain.com/blog), you have to tell WP where to go. So if you have WP in the BLOG folder, then your root .htaccess should be

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

    But if you have WP in blog and it’s RUNNING out of domain.com/blog, it should be

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

    (@mokidad)

    WordPress is installed in the root

    I’m using settings/reading to have the home page be static (unused) and the posts page is set to blog. That’s why the blog appears to be in a subdirectory

    (thanks for replying. I’m so stumped!)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    You can’t have BOTH WP in Root AND a static site.

    WordPress won’t run right in exactly the way you’re seeing.

    Thread Starter mokidad

    (@mokidad)

    Well, can I install wordpress in a subdirectory and act like it’s in root with my static site?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Not with a static site also in root.

    You can only have one thing in ‘root’, be it virtually or physically.

    Thread Starter mokidad

    (@mokidad)

    Thank you ever so much!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Preview and search broken’ is closed to new replies.