Don't have permissions to access my site on the internet

I have a site created in Freeway which has been okay for a number of years but I recently made a few minor alterations and now I don’t have permissions!v Also I get an error message 403 Forbidden!

Hi Norman,

What is the address of your site?

Hi Jeremy

The address is www.spitfire-design.co.uk

I contacted tsohost who are hosting the site and they sent this back:

Upon reviewing your account I noticed you were using custom-made “.htaccess” files which I have named “.htaccess.old”. I then created another “.htaccess” file with the basic default htaccess code:

BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

END WordPress

That did indeed work and the site loaded up but I assume that would only work if the Wordpress code is included. I intend to make more additions to my site and assume if I upload the html again, I’ll be back to square one.

Norman

I’m not sure where the .htaccess files came from - they’re not something that Freeway generates. So, unless you’ve somehow added them to your local site, they shouldn’t be overwritten next time you upload.

@simonmanning or @waltd might be able to shed some more light.

If you are actually using WordPress, and an Action to turn your Freeway pages into templates for that system, then that Action might also have some feature to create or adjust the .htaccess file. But as Jeremy mentioned, Freeway alone doesn’t do that. (Point in fact: I don’t think it can, because it would need special dispensation from the Finder to create or manipulate hidden files like this.)

Walter

Hi Walter. No, I’m not using WordPress and have no idea what the .htaccess file does.

My site was built in Freeway 7. After publishing the site, I uploaded the files from my site folder to TSOhost (who are hosting my site) using Transmit, but when I tried to access my site on Safari I was told I didn’t have permission. And was also given a 403 error code. I contacted TSOhost and explained the situation. They then added the WordPress code and the site worked fine when downloaded in Safari. I’ve no idea where they inserted the WordPress code and I don’t know if I uploaded my site again with amendments it would overwrite the WordPress code and not work again.

I’ve been using a combination of Freeway and TSOhosting for a number of years without any problems. So I’m hoping you can sort out the problem for me!

Let me know if you need any more info.

Norman

I doubt this has anything to do with Freeway, but what I would do in this situation is to use an FTP program and download a copy of the new (working) .htaccess file. Then if you have any problems next time you upload, you can see if the .htaccess file has been changed and (if so) replace it with your downloaded copy - although I think that everything in the new file is probably what you quoted above. You could also turn on Save Log in Freeway’s Upload dialog. This will keep a record of all the files that Freeway has uploaded, so you will be able to tell if it has changed the .htaccess file (which shouldn’t happen unless you have an Action that is doing this).

It might also be interesting to see what is in the old .htaccess file, which your host renamed as “.htaccess.old”. You should be able to use an FTP application to read or download this.

I have a theory, one that might be true, but it depends on a very specific set of options available in Transmit. Freeway, as discussed, has no way to alter the .htaccess file that I know of, and the more I think about it, the more I remember that the only way that an Action could create a file named .htaccess would be to name it something else on your Mac, and then you would need to rename it on your server with another tool like Transmit.

Here’s the relevant bits in Transmit:

I have Ask before deleting items on. (I think that may be a default.)

htaccess is listed as a “file extension” for file transfers. I believe this lets it upload such a file, since it starts with a dot in order to make it invisible, so treating that filename as an extension is kind of a hack. I don’t believe I added this by hand.


In the Sync Files overlay dialog, I leave the Delete orphaned destination files off, only ever turning it on if I really really mean it. I think when you are in this mode, it will ask you twice before doing it, but I didn’t want to test that theory in this production S3 bucket…

So my theory is that if you had that option turned on, and agreed to its warning, and also had the View / Show Hidden Files option enabled, then syncing a folder on your Mac (which very likely does not contain an .htaccess file) with a folder on your server that DID have one, might run a risk of deleting it from the destination, as it would be considered an “orphan”. I have not really tested that theory, it’s just a suspicion.

But again, if you are using Freeway to do the upload, you won’t have this issue. It never manipulates hidden files. It cannot make them, either.

And to answer what an .htaccess file does and is useful for, it’s a configuration file used by Apache Web servers (and others that follow its configuration pattern) to change the options for a specific folder on the server. You will generally find one either in your account folder, or in a “public_web” (or other named subfolder) that contains a set of files for a Web site. Apache uses it as a sort of very local set of configuration rules to govern how the server will behave with respect to certain file types, secured folders, etc. You can learn way more than you want to know about it here: https://httpd.apache.org/docs/2.4/howto/htaccess.html

Hope this helps!

Walter

1 Like

Hi Walter

I think I’ve solved the problem, purely by luck.

Freeway produces a file home.html but I had an idea that if I changed that to index.html (which I understand is an alternative) andit might work. And it did! I can now access my site. Maybe my host site tsohosting needs the index.html line to get started. Anyway, at the moment it’s fine!

I appreciate the time you’ve spent helping me. Thanks.

Norman

You are welcome. The clue to this is the index.html. That name is the default “automatic index page” filename for Apache, and by convention, if you have a file named thus in a directory (anywhere inside your defined Web root), if you navigate in a browser to just the directory name, like example.com/products/ you automatically and implicitly (and silently) get example.com/products/index.html. The .htaccess file may be used to alter that, by setting the DirectoryIndex configuration setting. mod_dir - Apache HTTP Server Version 2.4

Using that, you could set the automatic index to anything you want, including home.html. I didn’t pay much attention to the content of that Wordpress .htaccess file you posted earlier, but they were using it to set index.php up as a candidate, and there may have also been a home.html in there.

Freeway, by default, always makes a new index.html when you create a new site or add a new folder inside your site root. You have to go out of your way to change that behavior, up to and including deleting that file from within your site listing.

You might have missed that in the list, and started a new page called Home, and that’s how you ended up here. The key thing for you to do going forward is to rename that page (using the Filename field, not the Title field) in the Page Inspector. That way you won’t end up with no index.html again.

Walter