• Resolved Sharon Austin

    (@sharonaustin)


    Hi, I have an installation of WordPress 4.1.1 on a WAMP server, Apache/2.4.9 (Win64) PHP/5.5.12
    This particular installation has custom post types on it that we set up with the TYPES plugin. When I first set up the site, only the “home” page worked, but looking at previous forums I was able to make the following changes to the Apache settings:
    1. removed the hashtag from #LoadModule rewrite_module modules/mod_rewrite.so
    2. Changed AllowOverride None to AllowOverride All, and restarted WAMP
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be “All”, “None”, or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    AllowOverride None
    3. Flushed the permalinks
    4. Went to the Apache modules, and checked the “rewrite_module” to be “on”.
    At this point, and in my mind, strangely, I am actually able to get the custom post types to come up, but not the ordinary pages or file structures. For example, if I click on our custom post-type news-events, I get this:
    https://localhost/scratchsite1/news-events/how-can-we-help-when-you-when-you-are-feeling-stressed/
    …and the content and all the images appear
    but if I click on our ordinary “about” page, I get this: https://localhost/about
    and I get this error message
    Not Found
    404 Not Found
    The requested URL /about was not found on this server.
    Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80.

    The only other literature I have found is changing the “FollowSymLinks” from:
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>
    to:
    <Directory />
    Options FollowSymLinks
    AllowOverride FileInfo Options
    Order deny,allow
    Deny from all
    </Directory>
    My httpd.conf file is not quite an exact match to above, I have the following in my httpd.conf file:
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be “All”, “None”, or any combination of the keywords:
    # AllowOverride FileInfo AuthConfig Limit

    …and what I’ve tried to do is to add the words, “AllowOverride All” right after the FollowSymLinks portion, before the hashtag.

    The sites break every time.

    The .htaccess file on my local host matches the one on my scratch site, which is not on local host, and the settings on both sites are on “Pretty Permalinks” after being flushed from default. The scratch site on my self-hosted domain works fine, the one on local host doesn’t, so I’m sure I’ve done something wrong in setting up the Apache server.

    I would welcome any insights you have to offer. Thank you so much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The manual file editing was probably unnecessary, and may actually be causing some odd issues at this point. With WampServer, the only thing required to enable mod_rewrite is usually just clicking on the WampServer system tray icon > Apache > Apache Modules > scroll down to and select “rewrite_module” and the server will do a graceful restart on its own. After that mod_rewrite should be functioning.

    A quick before and after visual check:

    1) Before enabling the rewrite_module from the wamp icon menu in the system tray, open phpinfo() from the Tools menu in the WampServer project page and scroll down to “apache2handler”. mod_rewrite will/should not appear in the Loaded modules list.

    2) Enable the rewrite_module as I described above, and revisit phpinfo(). This time, mod_rewrite should show up in the loaded modules section.

    That should be all that’s required. No manual file editing needed.

    Thread Starter Sharon Austin

    (@sharonaustin)

    I’m really grateful for these detailed instructions you’re giving me!

    I restored all settings of the httpd.conf file back to their original settings. I stopped all services, unchecked the mod_rewrite module, and looked at the php.info file as instructed. As you had predicted, the mod_rewrite module was not present.

    Image: https://cloudup.com/cFs4WFOLie4

    I went to the modules, enabled the rewrite_module, and revisited phpinfo(), as instructed. As you had accurately predicted, mod_rewrite now shows up in the phpinfo() section.

    Image: https://cloudup.com/c2ryB-T4f9X

    I still seem to be having the same problem, however.

    When I click on a custom post type, I still get the same response with link structure, and all the content and images are displayed. I still get 404 errors with common pages, however.

    I’ll be back. I just remembered, I also have a “default” 4.2.2 scratch site that doesn’t have custom post types on it I should check too, with the new settings. Perhaps the comparison of the two sites could offer some insights.

    Again, thank you so much.

    Thread Starter Sharon Austin

    (@sharonaustin)

    Some promised follow-up.

    I think the problem may be related to the child theme we have, or possibly the settings we have for our Types plugin.

    The “default” WordPress 4.2.2 using a TwentyFifteen theme runs fine, as does a “default” WordPress 4.2.2 using the TwentyFifteen theme with the Types plugin on it. The problem seems to come in with this customized child theme that we created, and possibly to the way I imported data for it. I hadn’t realized at first that when I was testing the custom post types, I assumed everything was fine because I saw all the images associated with data I thought I had imported. A closer look showed that the images were actually pointing to the old site, not imported content as I had thought–and the custom post types weren’t actually working as well as I first thought. Please accept my apologies for not checking this more thoroughly before coming here.

    Still, there seems to be a problem associated with Permalinks on the 4.1.1 site with the child theme. On the other two sites, the basic 4.2.2 and the basic 4.2.2 with a TYPES plugin custom post type, the Permalink Settings is “Custom Structure”. When I try to set the Permalink Setting to the same in the local site with the child theme, it won’t allow me to “Save” the structure like that, and instead defaults to the “Post Name” option after each attempt to save the Permalinks.

    Image: Basic WordPress 4.2.2, no plugins, works with default settings
    https://cloudup.com/cTpsCDelv75

    Image: Basic WordPress 4.2.2 with Types Plugin Permalinks https://cloudup.com/c1e0oxqRTd4

    Image: Scratch Site WordPress 4.1.1 with child theme does not allow Permalinks to be saved as Custom Structure, but defaults to Post Name when saved. https://cloudup.com/cQyFBfOgDth

    Bottom line, I don’t think the problem has with anything to do with Apache, or the set up on localhost, I now think it’s a theme or TYPES plugin settings problem on my part.

    At any rate, thank you so so much for the feedback–it allowed me to clean up the httpd.conf file in Apache and simply check the rewrite_module. So simple, and so easy, and I really appreciate the input of the phpinfo() page.

    I personally think this topic should be considered “resolved”, since the default sites are working fine, but please feel free to re-open if you think it should remain open! Again, thank you for the help! I really appreciated it!

    I’m glad it helped a bit. I hope you get to the bottom of the issue with the plugin. Good luck to you!

    Thread Starter Sharon Austin

    (@sharonaustin)

    I promise you, it helped more than a “bit”! Thank you again! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘404 Error’ is closed to new replies.