• ChuckS

    (@chucks)


    When writing to the .htaccess file, it would be exceptionally helpful to add a comment that clearly states the purpose of the modification and possibly have a link to a complete description.

    Something like this:

    # BEGIN WordPress
    
    # Use "Month and name" option for permalinks.
    #    (see Settings -> Permalink for more info.)
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
    
    # END WordPress

    Recently, I imported an XML backup (from a wp 2.8.4 site) to a freshly installed wp 3.3.2 site. I started using the new site and noticed that the .htaccess file of the new 3.3.2 install hadn’t be modified and that the .htaccess file from the 2.8.4 install had been modified. I thought that this was because of some “improvement” in 3.x. Tech support from my ISP thought the same thing. I didn’t realize that my new site was using the default Permalink setting.

    Next, I tried to follow the “Using a pre-existing subdirectory install” instructions and it would have helped a lot if I knew how wordpress had modified the .htaccess from my old install.
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install

    Thanks,
    Chuck

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Did you know that code for your .htaccess is the same for all permalink formats? 🙂

    We do mention it here: http://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29

    Thread Starter ChuckS

    (@chucks)

    No, I didn’t know that, but I still think that some kind of enhanced comment could help. Perhaps, something like:

    # BEGIN WordPress
    # Code for permalinks (see Settings -> Permalink for more info).

    I think that this would help people who are not WordPress experts, but some WordPress experts might think it’s not needed. It would have helped me.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    That’s a sticky one… I mean, it’s explained a bit in /wp-admin/options-permalink.php, which is where most people encounter it (if they read the whole page). And nitpicking, I’d say we don’t really need to add more lines to the .htaccess, when the documentation on the help tab on that page explains it in full, with links.

    tl;dr: I don’t think people would read it :/

    Thread Starter ChuckS

    (@chucks)

    If one knows what the code if for, it makes sense that they wouldn’t support adding a comment line to explain it. Does WordPress modify the .htaccess file for other settings or options? If not, maybe the existing comments could add a word ie this:
    # BEGIN WordPress permalinks
    # END WordPress permalinks

    My scenario was that I rarely administer WordPress. I had to move an old 2.x installation to a new server. I made an XML backup and imported it to a freshly installed 3.3.2 installation. Both my ISP and I thought the fact that my .htaccess file hadn’t been changed had something to do with 3.3.2.

    I also think that when I change my Permalink Settings and wordpress changes my .htaccess file, that the success message should be:
    “Permalink structure updated. Your .htaccess file has been modified.”
    The .htaccess file is only mentioned if there’s a permission error.

    Making it more clear on why WordPress modifies an .htaccess file could save people time. That’s my point.

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

The topic ‘Add better comments when modifying .htaccess file.’ is closed to new replies.