• Hello everyone and many thanks in advance for your time and help.

    Spec:
    Installation: WP installed using Softaculous
    Version 3.2.1, updated through WP’s internal Update function
    Server: linux-based, hosting server using LiteSpeed
    Control panel: cPanel 11.30.3 (build 5)
    MySQL: ver. 5.0.91-community-cll

    Recently I set about pointing the site’s URL directly to the WordPress installation – something I had successfully done on another site I manage, the user could land directly at https://sitename.com/

    ….only this time the process went awry, and I cannot see how.

    As before, I did the transfers as instructed on the excellent Codex article https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory

    Everything went smoothly, until I tried to update the permalinks, when I got the message:

    “You should update your .htaccess now.”

    and, at the bottom, a code window, with the explanation:

    “If your .htaccess file were writeable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.

    I changed the .htaccess permissions to CMOD 766 and tried again, with the same result. So I (temporarily) changed them to CHMOD 777, tried again, but gain got the same result – which surprised me no end!

    Q. 1) Any idea what the problem could be there? What CHMOD should I be using?

    As a workaround, I copied the code into the .htaccess and carried on… but site lost a lot of the images and, when I tried to post and upload images, it could not find those either.

    I ended up creating a new directory for the WP installation, moving and pointing everything to it, deleting the old one altogether from the server. On the whole, worked, except…

    When I uploaded the images again form my computer, WP recreated the old WP directory name and structure, with just wp-content and new image uploads:

    |-> OLDWPDIRNAME
    |–> wp-content
    |—-> uploads
    |——-> year
    |———-> month
    |——-> thumbs-cache

    Only image uploads appear to be affected, the new directory I created is till there and works fine, updates work fine, the Theme is perfectly linked up, posts and pages, menus and plugins all work fine I even tried reinstalling WP to see if it would reset the directory links to the new one.

    I checked every file I could think of to find what generates a “create directory” that picks up the old directory name, but have not managed to identify the problem.

    Q.2) Any ideas/suggestions of files I should look at, that could be pointing to the defunct installation directory?

    Once again, thank you for your kind help.

    Gea
    _____________________________________________________________________
    PS (as an aside)
    Love the impeccable syntax of that message!
    “If your .htaccess file WERE writable…”
    instead of the nasty, horrible, wrong…
    “If it was writeable”

    FULL MARKS WP CODEX AUTHORS!!! EXCELLENT ENGLISH!!! MWAH! :o)

    And, no, I am not a snob; English is not my native language but, as an immigrant to the UK I tried hard to learn it to the best of my ability. It is a beautiful language and it’s a shame to let it be mangled by lazy usage, so it’s lovely to see some people still make an effort, and I just wanted to give credit where it’s due, that’s all.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Everything should be 755 except .htaccess in the root folder, and wp-admin/index.php, which should be 644.

    Thread Starter GeaVox

    (@geavox)

    Many thanks Jonas,

    I went and checked and I had restored the original CHMOD, but when I tried once again to save the Permalink, to get it to update to the new directory, it still tells me that .htaccess is not writeable.

    Ho Hum!
    Bit of a mystery, I guess.

    Thank you anyway.

    Cheers.
    G

    Everything should be 755 except .htaccess in the root folder, and wp-admin/index.php, which should be 644.

    Correction all folders need to 755 and all files 644

    Thread Starter GeaVox

    (@geavox)

    Thank you also Govpatel!

    I will check the whole system’s CHMODs again.

    I think I know what went wrong with WP (and it’s too dumb to credit it… I forgot to change the path of the Media Upload page, in Settings and yes, I am blushing furiously!)

    The problem with the .htaccess not being writeable persists though, and I can;t seem to get the permalink update to write to it.

    Ho Hum.

    Thank you for your time.

    I am a daft, daft, DAFT old bint!

    ??

    Correction all folders need to 755 and all files 644

    Can you document that? I don’t think that’s true.

    You can check it here fro linux servers
    https://www.zzee.com/solutions/linux-permissions.shtml

    Permissions required for web server

    Web server assigns the rights of the web-server-specific user, typically user “nobody”, to the connected web client, as if “nobody” is connected to the web server. “Nobody” doesn’t belong to your group and thus it inherits permissions that “others” have to your files.

    For generic files such as html or images, etc you usually need to set 644 permissions. It is because “nobody” needs to read the file, and thus the file should be readable by others, hence 4 (read only) permissions for both group and others. For yourself you need a right to read and write (hence 6) to the file.
    For scripts you need 755 rights. The script should be executable by “nobody”. The script file should also be readable by “nobody”, as the file is interpreted by an interpreter such as Perl and therefore must be readable. Thus it must combine read and execute permissions for “others”, as “nobody” belongs to “others” group. For yourself you need to have also write access, getting 755 as a result.

    YMMV

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Tried "Giving WordPress its Own Directory While Leaving …" gone a bit wrong!’ is closed to new replies.