.htaccess Examples

What do you mean? It works.

not for me

Did you clear your cache? Are there other .htaccess rules contradicting it? What happens when you first a 403 error?

1 Like

litespeed 403

yeh

no

Can you share your .htaccess code, as well as the location of the .htaccess file?
Thanks

1 Like

/public_html/.htaccess

htaccess (3.6 KB)

Had to download it as I couldnā€™t copy it

Hmm. Did you see the big DO NOT EDIT at the top of that file before you started editing it? Or did you see this line?

Manual editing of this file may result in unexpected behavior.

I donā€™t know what to tell you. You may need to deactivate the account and get a new one as editing that .htaccess file can mess up your site big time.

1 Like

yeah

canā€™t do that, iā€™m technically paying for this (although i am getting free staff plan)

no, that was from editing php.ini

Wait, so you are on premium hosting? Now Iā€™m confused.

So you copied some stuff from this other file into your .htaccess file?

So is public_html a folder on your site than? Like htdocs/public_html/.htaccess?

I would just delete the file and start over, it looks like you have a ton of other stuff in the file that might not belong.

1 Like

im on another host. (you remenber comfyy/exploreweb, its his host)

cpanel did it.

no, its /public_html

i have too much stuff in there.
the site works fine, except https://theepiclycookbook.cf/.htaccess (denied by server) doesnā€™t display my provided 403 error page

also ty for the fast reply

Than some things might be different, i would contact his support as this form is only for IF users.

Still confused. Where is this folder?

But it does show a 403 errorā€¦

and if that .htaccess file is not in the root folder, then the 403 wound be the default one because this new file is not in effect yet.

Can you just share your file structure? And maybe ask the support of the hosting company you are actually usuing?

1 Like

in my main directory

well, their server has apache so i thought it would work.

not my 403 error

its in the public_html folder

Where is that public_html folder? Please tell me your file structure.

Well it might, but as I said this form is for IF users only.

1 Like

ok, iā€™ll try that

Its the file structure of a standard cPanel Account:

Server Root / home / USERNAME / public_html

For users public_html is a folder the same as htdocs.

1 Like

You realise this does work on those servers? Sometimes the server just gets a bit fudgy with it.

Two things you need to make sure of:

  1. Do not use a full URL, just the path (eg /hi/there.php instead of domain.com/hi/there.php)

  2. Include the file extensions

2 Likes

I have added some additional information at the bottom of the article if it is useful to anyone.

7 Likes