• Resolved jageo

    (@jageo)


    A customer of mine has a WordPress site installed on their web host – it’s been running for years, and they’ve asked me, at long last, to move the site to https://
    After purchasing the security certificate and getting it installed, and tested this web host tells me my next step is to move all my files from the “public” folder into a folder called “secure”
    (I’ll attach a link here to the *elaborate* (jk) screenshot they provided)
    https://www.dropbox.com/s/c42puwtqxtd8kjk/screenshotcom2.png?dl=0

    Now, i’ve installed WordPress in subfolders before, but this doesn’t seem to be quite the same. My config file doesn’t currently have anything special that says it is running in the ‘public’ folder, so I don’t think i should anticipate changes to it when moving everything to this ‘secure’ folder.
    And apart from changing all the URLs to “https”, does anyone think the database will need changes?

    does anyone have any experience with moving site files like this?
    Do you think it looks to be as simple as
    a) move the files
    b) no changes to config.php

    I would like to install ReallySimpleSSL plug-in to manage the URL changes and redirects, but i suspect that wont work. Something needs to remain in the “Public” folder to redirect any “https://” requests to the “https://” location.
    Does that sound correct?

    Many thanks
    J A

Viewing 9 replies - 1 through 9 (of 9 total)
  • Stef

    (@serafinnyc)

    Who’s the host? I’ve never heard of moving anything to a secure folder simply because of an SSL being added. Super odd.

    As for ReallySimpleSSL you won’t need that either. You can simply write a redirect in the htaccess file.

    Like so

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
    Thread Starter jageo

    (@jageo)

    The host is Telus, a phone/internet/TV company here in Canada. The customer of mine is a business and is getting this shared hosting for *free*, which makes it difficult to sell them on the idea that i can find them something better.
    And yes, i think moving all the files is unusual. I have worked with maybe ten different hosting companies, and no one has asked for this step. Its exasperating.

    1) So with the redirect in the htaccess file – that would live in the “public” folder
    2) But i still need an htaccess in the “secure” folder
    3) and i would still need to change the siteURL and find/change in the database to update any hard-coded references to the http: URL that may exist?

    does this sound like a reasonable plan/expectation?

    Stef

    (@serafinnyc)

    So strange. I’ve never heard of them, but that doesn’t mean much. :o)

    1. yes, every site, sometimes separate folders has an htaccess file in it. You’re going to want to edit the one that sits in the directory of your WP install. So if you leave it where it is right now, then edit that one. If you actually end up having to go into a folder called SECURE then edit that in there.

    2. Yes

    3. Not necessarily. I wouldn’t move anything until you are 100% positive this is needed. I would also speak to their support on how to address any subfolder rewrites. You can have a site be inside a subfolder but it will still be yourname.com it wouldn’t be yourname.com/subfolder. Right. Like no one wants a site like that. Ask them how to address that as well. Unless they plan on doing that for you.

    Thread Starter jageo

    (@jageo)

    I have already had conversations with their support team, they can not answer any questions re: moving a wordpress site. Tho’ i did not ask specifically about rewrites.. at least not without the word WordPress in the sentence (which may have been the dog whistle, so to speak, that made them deny any knowledge)

    But if you’re curious, and care to follow along…
    I have *copied* all the files that live in “public” to “secure”. I have NOT yet changed any of the htaccess files.
    – When i visit the site: https://www.fortmacleodgazette.com i am redirected to https://
    – If i visited an individual post page i got a white screen and a ‘not found’ error message.
    – But i was able to login and go the admin page, where i changed the site URL to https://, that appears to have cleared that up

    So my two concerns at present:
    1) i haven’t changed the htaccess file. it is still the basic:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    2) the browser still says the site is not “fully secure” which makes me think there must be some hard-coded URLs to images (most likely?) on the pages, which i should be able to suss out by viewing the source code.

    i’ll continue to update this ticket if i discover or learn anything else.

    Stef

    (@serafinnyc)

    Glad you got that squared away. I am not however redirected and I’ve never been to the site. So something’s not right.

    With regards to the htaccess you want to write below the mod rewrite. It should have something like this below it

    ## End WordPress ##

    You’ll add your http to https rewrite after those. Ah, sorry, forgot the images. I always forget about that. So, in that instance you may have to look at a plugin that can take care of that for images. There are several search and replace plugins out there. Just read reviews on them to see if that helps.

    • This reply was modified 4 years, 8 months ago by Stef.
    Thread Starter jageo

    (@jageo)

    that #End WordPress# is there… i missed copy/paste that line into my code sample above. Mea culpa ??

    ..and you’re right about the not auto redirecting – am running around testing different machines in the house. I will mess with the htaccess file that lives in the public folder next.

    @jageo How did you finally resolve this?

    I’m faced with the same issue (crappy Telus hosting support… lol). I see your site is working now.

    What came to my mind was doing a fresh WP install into the secure folder, migrating the DB (with the paths rewritten),Then copying the WP files into the new secure folder.

    If that works out I would only need to do a redirect from the public folder to the secure folder? If I’m going about this the right way?

    I was going to use the Really Simple SSL plug as well as it has served well on other sites (with better hosting)

    Thread Starter jageo

    (@jageo)

    @gaszer I did not need Really Simple SSL in the end.
    1) i *copied* all the files first rather than move.
    2) I added this redirect to the .htaccess file in the /public folder

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.fortmacleodgazette.com/$1 [R,L]

    3) I did have to hunt down maybe three or four places where i had hard-coded some https:// . i did this by visiting pages that i knew used different templates and viewed the source code.

    I’m still having trouble with Telus re:their phpMyAdmin interface. (if you can believe it, their software drops me into a database from *two years ago*, while the site is obviously using a different, current, database.) But I needed a breather, so i stopped arguing with them. I will return to this later.

    @jageo Thanks for that last bit. Just wanted to thank you for the input on the .htaccess file.

    You save me banging my head around. And Telus hosting is really something of a joke. And the phpMyAdmin had me scratching my head as well… :0)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Need to move the files to subfolder for SSL’ is closed to new replies.