WordPress.org

Forums

Are Permalink and Image Upload issues connected to .htaccess? (28 posts)

  1. pushkin
    Member
    Posted 3 years ago #

    I'm still having weird Permalink problems – see thread here (http://wordpress.org/support/topic/whats-causing-categories-and-tag-links-go-to-error-404-page?replies=14#post-2783009) – which Esmi suggested had to do with the .htaccess file and that I should get in touch with my host, which I did but they were no use. Now, I'm not able to upload images to my site – getting html errors on crunching. I've looked around and, again, implications are that it's to do with .htaccess file. So, I've gone into my FTP manager and located four .htaccess files. The code in each is below. If anyone knows about these things, could they say whether these files are where they should be and say the things they're supposed to say. Any other suggestions as to my issues would be much appreciated. Thanks.

    1. html directory>.htaccess

    # 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

    2. db backups>.htaccess

    AuthType Basic
    AuthName "User Backups"
    AuthUserFile /home/content/03/9159303/html/stats/.statspwd
    require valid-user
    Options +Indexes

    3. current>.htaccess

    # 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

    4. WP admin>.htaccess

    # 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
  2. stvwlf
    Member
    Posted 3 years ago #

    There should not be an htaccess file in http://yourdomain.com/wp-admin/

    What is the folder /current/ for? Do you have more than one WordPress installation in that same hosting account?

    If your WordPress site is installed in the root folder, the first htaccess file you listed is correct.

    the one in /db-backups/ is most likely for a backup plugin and should be correct.

    The one in /current/ is questionable. However if your URL's on a WordPress install in the root folder don't contain /current/ in the URL Apache should never be accessing that file in the /current/ folder anyway. If you have a second WP install in that folder that htacess doesn't seem correct - the Rewrite Base would be different.

    What about your settings in the Dashboard - Settings - Permalinks section?
    What is your active Permalink structure?
    Do you have a Category Base or Tag Base set?
    Have you reset the Permalinks to "Default" and Save Changes, and then set them back to what you actually want them to be? That causes WP to recompute its internal URL redirection instructions.

  3. pushkin
    Member
    Posted 3 years ago #

    Thanks for the detailed response. I'm going to pass on all this .htaccess file information – including your observations – to Go Daddy and ask them to investigate. Regarding Permalink settings, I've tried resetting, to no avail. I had set it up for Permalinks to work on Post name; but categories and tags go to error 404 page. Similarly, in numeric, default, day and name, month and name, categories and tags work, but posts go to error 404 page. The (unsatisfactory) solution I've come up with is to use Custom Structure and a mixture of Numeric and Post name – i.e. /archives/%postname%/. So my post URLs are now something like this:

    http://golovegreece.com/archives/aegina

    Tags read: http://golovegreece.com/archives/tag/aegina/

    Categories read: http://golovegreece.com/archives/category/cities/

    All add 'archives' to the Permalink; but at least no error pages. Naturally, I'd like to get links without 'archives'.

    The category base and tag base fields are empty.

  4. stvwlf
    Member
    Posted 3 years ago #

    what about the /current/ folder? why would there be an .htaccess file with the WordPress code in it in that folder? Is there another WP install in that folder? If not, how did it get there?

  5. pushkin
    Member
    Posted 3 years ago #

    I've asked Go Daddy whether my .htaccess files are in the right place and say the right thing. I don't know why there's an .htaccess file in current folder or what it means if it is there. Are you suggesting I delete the current folder?

    To see what these files look like in FTP manager, I've made a couple of screenshots and uploaded them.

    http://i1171.photobucket.com/albums/r556/pushkin64/FTPdirectory1.png

    http://i1171.photobucket.com/albums/r556/pushkin64/FTPdirectory2.png

    The first screenshot shows FTP manager after opening.

    The second screenshot shows current in left hand column after opening.

    Does this look right?

  6. stvwlf
    Member
    Posted 3 years ago #

    Current looks like a portion of a WordPress install. Could you have copied some WordPress files into another folder at some point?

    Just to be safe, I suggest you rename the .htaccess file in /current/ to something like .htaccess_save While its probably not causing the problem, it eliminates one potential source of a problem.

    getting html errors on crunching.

    What are the exact errors you are getting?

  7. adpawl
    Member
    Posted 3 years ago #

    all files from current directory move to root directory (html).
    Remove this htaccess from wp-admin catalog.

  8. svencooke
    Member
    Posted 3 years ago #

    Excellent advice Puskin. This helped me out as well.

  9. pushkin
    Member
    Posted 3 years ago #

    Thanks for advice on what to do with .htaccess folder. I'll try out these solutions later this evening.

    On getting HTML error on crunching images; what I mean is this. I upload an image via Media Library>Add New. It goes through process of uploading the image, getting to 100% and then when it's time for it to be smushed (I have the plugin WP-Smush.it installed), I get an HTTP error at the top of the page and uploading fails to complete. I've tried deactivating the plug-in and while the image will load, when I try and reactivate the plugin and smush the image manually, I'll get an error saying 'operation timed out' or 'cannot find host'. Just to say, I've had the smush.it plugin installed for a while, smushed dozens of images with no problems - until now.

  10. stvwlf
    Member
    Posted 3 years ago #

    1) Plugins that have been working fine for a while don't just one day stop working when nothing has changed. Something has changed in your WordPress setup.

    2) The upload process works fine without the plugin. So what you are saying by this is you have a problem with the WP-Smush.it plugin, not with the WordPress upload.

    What is the EXACT HTTP error that you see at the top of the page?

    Is it possible smush.it is conflicting with another plugin? Can you disable all plugins but smush.it and see if you still have this problem? If it goes away, turn the others back on one at a time to find the one that conflicts.

  11. pushkin
    Member
    Posted 3 years ago #

    I've just received the following reply from Go Daddy on .htaccess file:

    We cannot review the .htaccess files in their entirety. We can review to see if there is an issue with a particular portion, as in if it is a conflict on shared hosting. However, we cannot troubleshoot your .htaccess files in such a general fashion.

    In regard to the /current folder, this is not a folder that we created. It appears there were also recommendations made regarding this folder. The best method of troubleshooting this type of issue is to disable .htaccess files by renaming them to .htaccess.bak and see if this resolves the issue.

    In addition, it is sometimes helpful to find a default .htaccess file for your application online and upload this and then make the necessary adjustments, such as enabling permalinks. This will insure that you are starting with a 'good' .htaccess file.

    I think this ties in with advice received above from stvwlf and adpawl and will give it a go later this evening and report back. Thanks for help so far.

  12. pushkin
    Member
    Posted 3 years ago #

    The exact error is a pink box at top of page in which it says HTTP Error, at which point the uploading process stops. I'll try and see if smush.it is conflicting with another plugin, but I haven't added any recently, so not sure that this is problem.

  13. stvwlf
    Member
    Posted 3 years ago #

    You have to eliminate possibilities one at a time, as the source of problems can be many. Since you are having a problem with the plugin, possibility of other plugins conflicting exists. Since you say you haven't added any plugins recently that is a less likely source of the problem.

    In terms of what adpawl said about moving contents of /current/ into the root folder - not enough files were visible in your screenshot to see what files are already in the root folder. I think it most likely that the files that are in /current/, which contains WP files that go in the root folder of a WP install, are ALREADY in the root folder. Otherwise your WP install wouldn't work at all. You might just want to rename the /current/ folder to /current.bak/ also, to get it out of the way of any possible involvement in this issue.

    Why are all of those image files in your root folder? Are they supposed to be there?

    Go to Dashboard / Settings / Media - what is in the
    "Store uploads in this folder" field?

  14. pushkin
    Member
    Posted 3 years ago #

    I've tried deactivating plugins in combination with smush.it and uploading images after, and sometimes images will complete processing correctly, sometimes they won't. When I think I've identified a problematic plugin and turned it off, I'll try uploading images again and the error message re-appears. It seems quite arbitrary.

    Don't know how images got into root folder. I've just been uploading images as normal into my library, though as I've been developing the site I have uploaded a lot of images, maybe 200; though, currently, after some deletions, I've 92 images in my media library. There's nothing in the 'Store Uploads in the Folder' field. It's on default, which is wp-content/uploads

    As for messages I get when processing images fails, I notice that apart from the HTTP error on the uploads page, if I go into the media library and try and smush an image manually, the error message here reads:

    Could not find /home/content/03/9159303/html/wp-content/uploads/

  15. stvwlf
    Member
    Posted 3 years ago #

    This is an important error message

    Could not find /home/content/03/9159303/html/wp-content/uploads/

    I suggest you pass on to GoDaddy that you are receiving that and ask why. (that suggestion assumes the above is the correct server file path to your uploads folder)

  16. pushkin
    Member
    Posted 3 years ago #

    Thanks stvwlf. I'll get in touch with them as you suggest.

  17. pushkin
    Member
    Posted 3 years ago #

    I've given up trying to get the Permalink I want, and settled for having 'archives' in all the URLs and avoiding the 404 page. I've also deleted the smush.it plugin and will 'crunch' images before uploading them to the site.

    However, I've still got issues, which I'm sure are related. They are when trying to instal the WP Super Cache plug in, I get the following message:

    Warning! /home/content/03/9159303/html/wp-content is writeable!

    You should change the permissions on /home/content/03/9159303/html/wp-content and make it more restrictive. Use your ftp client, or the following command to fix things: chmod 755 /home/content/03/9159303/html/wp-content/

    What does this mean? I've looked for /home/content/03/9159303 file in FTP and can't find it?

    Also, if I try and use the search field on my site – http://golovegreece.com/ – top right hand corner; and put in something that will return more than one page, for example, Athens, while page 1 of Search Results brings up the relevant results, if I try to bring up page 2 or page 3 of Search Results (bottom left corner), I get a 404 (Page Not Found) Error.

    Is this a Theme, WordPress or Host issue?

    Thanks for any help.

  18. pushkin
    Member
    Posted 3 years ago #

    I should add that regarding the 'extra' folder /current/ showing up in the directory, in the end I noticed that it contained duplicate files in the html directory, so I deleted the current folder. It didn't solve any issues, unfortunately.

  19. stvwlf
    Member
    Posted 3 years ago #

    Hi

    This is the full server path to your WP install, on the GoDaddy server:

    /home/content/03/9159303/html/wp-content

    FTP will probably show /home/content/03/9159303/html/ as your root folder. What the message means is the folder /wp-content/ in the root folder should have its permissions set to 755. Usually you right click on the folder in your FTP program and it offer a menu option for Properties on the menu that comes up. Change the folder permissions to 755.

    If you are using the hosting control panel file manager, highlight that folder. Then find the option that lets you change the file permissions and set them to 755. That hopefully takes care of Super Cache's error warning. By the way, I suggest not turning on caching until you have resolved all of these other issues. Having caching turned on is only going to make debugging these issues more complicated by adding another whole set of possible problem sources.

    Have you or your theme created custom search code by any chance? The error you report (404 on page 2) usually occurs when a custom query has been created that modifies the default.

    One form of the code to resolve it looks like this:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts( $query_string . "&paged=$paged" );

    but it depends on how your theme is coded. If you've not changed any code concerning searches you might direct the problem to the theme author. It looks like you are using a Premium theme.

  20. pushkin
    Member
    Posted 3 years ago #

    Thanks very much for detailed response.

    In FTP>WP-Content, I can get into Set Permissions. I can't see any numbers to change, but it gives me two options:

    1. Permissions: Set Permissions for selected files/folder, then there's two boxes: Web Visible (which is clicked) and Executable (not clicked). I've made a screenshot here: http://i1171.photobucket.com/albums/r556/pushkin64/FPTpermissions1.jpg

    2. Advanced Permissions: One row says Web User Permissions, the other says Owner Permissions. All boxes – Read, Write, Execute (Directory) are on. Screenshot is here: http://i1171.photobucket.com/albums/r556/pushkin64/wpcontentpermissions2.jpg

    What do I need to change to get the equivalent of 755? Thanks

  21. stvwlf
    Member
    Posted 3 years ago #

    One more reason GoDaddy hosting leaves things to be desired when hosting WordPress. I can't tell from that what settings equate to 755. Googled and it wasn't much help. See here
    http://support.godaddy.com/groups/web-hosting/forum/topic/i-need-to-chmod-a-file-to-755

    GoDaddy's system is apparently set up so very untechnical people aren't overwhelmed with complicated details. However that makes it hard for people who know what they want to accomplish to do so.

    Either contact GoDaddy support and ask them what combination of boxes equals 755, or download a desktop FTP program and make the change in there. A commonly used free one on a Mac is called Cyber Duck. I prefer Filezilla http://filezilla-project.org/download.php but its a little more technical. Either should let you set file permissions in the normal way, with numbers like 755.

  22. pushkin
    Member
    Posted 3 years ago #

    I managed to change permissions with Filezilla. I changed everything to 755. It took a while, but everything went through. Thanks for showing me how to do this. However, it hasn't solved my Permalinks issues, and I'll now get in touch with the Theme designers to see if the problem isn't something to do with the Theme.

  23. stvwlf
    Member
    Posted 3 years ago #

    Hi

    When you say "I changed everything to 755", only folders are supposed to be 755. Files are to be 644.

    Sorry if that created extra work for you. I was suggesting only that you change the one file that SuperCache was notifying you about.

  24. pushkin
    Member
    Posted 3 years ago #

    Oh, dear! Should I change everything back? It didn't really create work for me. It just runs in the background. It's not a big deal to change it all back. Is that what I should do? The site doesn't seem to have been affected one way or the other.

  25. stvwlf
    Member
    Posted 3 years ago #

    files should be 644
    folders should be 755

    it is important for securing your site against malicious behavior

  26. pushkin
    Member
    Posted 3 years ago #

    This screenshot – http://i1171.photobucket.com/albums/r556/pushkin64/Filezillapermission.jpg

    shows what wp-content looks like after I changed it.

    Should I now go Numeric Value 644 with 'Apply to files' button on

    and

    Numeric Value 755, with 'Apply to directories only' button on?

  27. stvwlf
    Member
    Posted 3 years ago #

    yes

  28. pushkin
    Member
    Posted 3 years ago #

    All done. Thanks for holding my hand through the process. I've dropped a line to my Theme designer explaining Permalinks problem. Maybe they can help. I hope so.

Topic Closed

This topic has been closed to new replies.

About this Topic