• Mark

    (@markdhamill)


    Anyone else have this problem or some up with a solution? I invest so much time rewriting the rules and something overwrites them. My web host says it is not something they are doing.

    Here is my modified file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^advice(/?)$ category/advice [R=301,L]
    RewriteRule ^best_of_occams_razor(/?)$ category/best-of-occams-razor [R=301,L]
    RewriteRule ^history(/?)$ category/history [R=301,L]
    RewriteRule ^life_2003(/?)$ category/life-2003 [R=301,L]
    RewriteRule ^life_2004(/?)$ category/life-2004 [R=301,L]
    RewriteRule ^life_2005(/?)$ category/life-2005 [R=301,L]
    RewriteRule ^life_2006(/?)$ category/life-2006 [R=301,L]
    RewriteRule ^life_2007(/?)$ category/life-2006 [R=301,L]
    RewriteRule ^metaphysics(/?)$ category/metaphysics [R=301,L]
    RewriteRule ^philosophy(/?)$ category/philosophy [R=301,L]
    RewriteRule ^politics_2003(/?)$ category/politics-2003 [R=301,L]
    RewriteRule ^politics_2004(/?)$ category/politics-2004 [R=301,L]
    RewriteRule ^politics_2005(/?)$ category/politics-2005 [R=301,L]
    RewriteRule ^politics_2006(/?)$ category/politics-2006 [R=301,L]
    RewriteRule ^politics_2007(/?)$ category/politics-2006 [R=301,L]
    RewriteRule ^sociology(/?)$ category/sociology [R=301,L]
    RewriteRule ^technology(/?)$ category/technology [R=301,L]
    RewriteRule ^the_arts(/?)$ category/the-arts [R=301,L]
    RewriteRule ^atom.xml$ wp-atom.php [R=301,L]
    RewriteRule ^index.xml$ wp-rss2.php [R=301,L]
    RewriteRule ^index.rdf$ wp-rss.php [R=301,L]
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    
    # END WordPress

    I can set a cron to copy over the file periodically but that doesn’t solve the problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Have you read up on the chmod command? Why not make your .htaccess read-only except for when you need to change it?
    This page may help elaborate on that: Changing_File_Permissions

    Secondly, and much more importantly, don’t put custom stuff between the
    # BEGIN WordPress
    and
    # END WordPress
    area. That’ where WP puts stuff. Every time you visit Options -> Permalinks you run the risk of losing your stuff. Put your own lines elsewhere in the file.

    Thread Starter Mark

    (@markdhamill)

    Thanks for the suggestion. I’ll move some lines around in the .htaccess file as you suggested and see if that solves the problem. I have not enabled a cron yet.

    Thread Starter Mark

    (@markdhamill)

    The suggestion worked! Thanks. This topic can be closed.

    Not really closed – but set to resolved, which YOU should do ??

    MarkDHamill – thanks for reporting back and very glad to hear it helped.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘.htaccess file being overwritten’ is closed to new replies.