• Resolved gbarber

    (@gbarber)


    I’ve searched the forums here and with the new host (dreamhost) and so far am just going in circles. I’ve tried a dozen and one different combinations of setting up the htaccess files for this and can’t seem to figure it out. Apologies if this has been discussed a million and one times already, but nothing seems to be working and I really just need a straighforward answer from someone.

    Basically, with my old host permalinks were set up as: index.php/%year%/%monthnum%/%day%/%postname%/ and the new host is set up as: /%year%/%monthnum%/%day%/%postname%/.

    I’m trying to just create a basic rewrite rule in my htaccess file that redirects people when the click on an old link through Google that has the “index.php” to a url with out. This should be fairly simple htaccess rewrite rule stuff, but for some reason NOTHING is working. It appears that the automatic WP rules are interfering.

    My htaccess files is as follows (which could be screwed up at this point since I’ve tried so many variations):


    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteRule ^.+.php$ /bogusfile
    RewriteRule index.php/(.*) /$1 [R=301]

    # WP Fix
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/failed_auth.html$
    RewriteRule ^.*$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php

    </IfModule>

    # END WordPress

    Can someone just tell me very clearly, without pointing me to a tutorial on how to write an htaccess rule, what I need to do to make this happen. I’ve already spent over six hours researching and nothing is working. I’d appreciate any help I could get.

    My site is located at: https://www.playswellwithothers.net and you can basically take any entry and add the “index.php” in there and see what happens. Most people come from Google links that have the “index.php” on it, so they are getting either a 404 page or the “No input file specified” page, depending on what I tweak in the htaccess file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gbarber

    (@gbarber)

    Oh my freaking GOD!!! I think I finally figured this out through trial and error and other suggestions I’ve found on this board. Here’s the solution that I ended up with:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php/(.*)$ https:// www .playswellwithothers.net/$1 [R=301,L]

    # WP Fix
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/failed_auth.html$
    RewriteRule ^.*$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php

    </IfModule>

    # END WordPress

    Ugh. Thank GOD!!!

    Awesome! Glad you got it to work.

    .htaccess is one of those things that’s beyond me. glad it’s working for you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Permalinks with new host’ is closed to new replies.