Need help undoing problems I've created and URL/SSL redirects

Permalink
I've been trying to get a site to do what I want, and in playing around, I think I've probably messed things up more than I can repair on my own. :-)

First off, I created a site using ImpressPages and got quit a bit of content on there before I started having issues with their text blocks not allowing some of the characters I needed (mathematical, chemistry, etc) and after being locked out of my hosting account three times because of the way it was handling the saves, I got peeved and installed Concrete5.

Only, I installed it in a temp directory and only read the editor documentation. I used the clonamental theme without understanding what all the various options and settings meant. (The documentation is outstanding, by the way. I just should have started with the developer video instead of hacking away at it... lol) The last site I did was originally written in a text editor, before I moved to Coda (and still pretty much wrote by hand), so I pretty much ignored the blocks and stuff on the original template, thinking it was closer to how ImpressPages works than it is.

When it looked the way I wanted, I (mostly) followed the instructions for moving a site, and got it working in the root directory. I started looking at Google Analytics and realized I'd linked something to a page that wasn't recreated in the Concrete5 version, and my sitemaps were old and something was undefined, and oh, only one page redirects to HTTPS.

I went into my hosting account to set up a redirect and managed to break pretty much the entire site :-) and when I started reading through how to set up the two redirects I want to happen, I started to realize that I've mangled it all up pretty badly. I've thought of cleaning out the home directory and doing a fresh install of C5 and redoing the site, but with less unauthorized customization, however I don't want to have to redo all of the content.

TL;DR: I've trashed the templates and views of my site and would like to standardize it, without having to recreate all of my content. I would also like use the domain apex without www and have all pages encrypted. I seem to only be allowed one redirect with my hosting provider, and trying to do both www/non and http -> https creates a loop forhttp://domain.

The site ishttp://keto.tech, if it matters. Many thanks for any pointers.

ketolaura
 
VPenkov replied on at Permalink Reply
VPenkov
Can you be a bit more specific?
What exactly did you break? What behaviour did you want and what did you get?

For the HTTPS redirect, go to your yoursite.com/index.php/dashboard/system/seo/urls
Under the "Cannonical URLs" section, set BOTH fields to https:// yourwebsite.com

This will force HTTPS redirection (sort of).

Additionally, you can place this in your header.php:
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){
    $redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: $redirect");
}



If you're using Varnish, this is likely not to work so you'll have to try this:
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'http'){
    $redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    header("Location: $redirect", 301);
}
ketolaura replied on at Permalink Reply 1 Attachment
ketolaura
I didn't understand the layout concept, applying templates, global blocks/stacks, forms, and well, pretty much all of it, so I deleted some stuff which turned out to be somewhat important. :-) Like the content part of Composer (attached screenshot).

I'm pretty sure I've messed up other things, as well, but I don't think it's worth the effort to find and fix all of it. I'm not sure where the data portions are stored and if I'd need to carry over anything of the config to get things like images working.

I recently did the upgrade and have looked at the files that were changed, plus ones I've modified recently, but I've not spent a ton of time doing a comparison. I've also got some leftover stuff from ImpressPages, but I'm not sure which is which. If I'm going to need to spend a few days copying and pasting into a fresh site, I'd rather do that than spending a few days figuring out all the stuff I screwed up and undoing it.
VPenkov replied on at Permalink Reply
VPenkov
So now you're wondering if you can make your website work with the composer from its current state?
Sorry, I can't figure out what information you're looking for here.
ketolaura replied on at Permalink Reply
ketolaura
Ah, yes, I guess I'm looking for the primary files to replace. For example, I created the first page and deleted sections, trying to get it in the layout I wanted. Then I deleted fields on the composer page, added some, and renamed one or two. Now they don't work as expected.

I created some page types, which is where I should have made some of the changes earlier, but I can't apply it to the existing page and I can't create a new top page.

I didn't like the default order of the header and footer, so I used the existing placeholders for something different, and the formatting from CSS is expecting a different type of object. So, I updated different portions of the CSS from the template so that part works correctly now, but I couldn't change themes because most things aren't what they're supposed to be, in order for that to work.

If I wanted to get the home page and global elements back to the standard, which files would I need to replace/update?
VPenkov replied on at Permalink Reply
VPenkov
Did you actually edit the theme files to edit area names and stuff?
ketolaura replied on at Permalink Reply
ketolaura
Over the last month, I've edited several files directly, both inside the theme directory and elsewhere. At least one was directly related to class names in a division. I believe that was a controller.php file? I removed part of the footer from one of the php files. Definitely modified CSS in several places.

(Don't worry, I'm not a programmer or web developer. I only subject myself to my own work ;-) )
ketolaura replied on at Permalink Reply
ketolaura
I decided to buy a theme and recreate the page correctly. Thank you very much for your help!
ketolaura replied on at Permalink Reply 1 Attachment
ketolaura
"For the HTTPS redirect, go to your yoursite.com/index.php/dashboard/system/seo/urls
Under the "Cannonical URLs" section, set BOTH fields to https:// yourwebsite.com

This will force HTTPS redirection (sort of)."

I did try that, but it won't let me set the first field to anything except http.
ketolaura replied on at Permalink Reply
ketolaura
If anyone else is looking for redirecting all URLs to https without the www, this code in the .htaccess file is working for me:

RewriteOptions inherit
        # -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#force www to apex
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^(.*) http://%1/$1 [R=301,NE,L]
#force https
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]