.htaccess file problem

pls help! when i try to transfer a .htaccess file to the folder ‘htdocs’ it will delete automatically! and the website is broken for this

Hi and welcome to the forum

3 Likes

thanks, my .htaccess file is 13k/10 so… i cant upload it :frowning:

try removing comments if you have a lot of them in that file

comments are like ‘## EXAMPLE##’ ?

yes - everything starts with #

2 Likes

thanks i will do it :slight_smile:

2 Likes

it didnt changed :frowning:

the file size is now?

(13 kilobyte)

does your file contains a large amount of IPs
in terms of blocking unwanted visitors?

if yes - try reducing that list to use IP range /24 /18 /13 and the like

and if it does not contain some sensitive data try uploading it to the forum
and change its extension to .txt

so someone will probably help you reduce your size


Update - my apologies it seems that since recently the forum no longer allows uploading .txt extension

2 Likes

Ok i will upload it tomorrow bcz now i cant, bye and thanks you

3 Likes

here it is the file @Oxy 12.7 KB file on MEGA

1 Like

can someone help me with the size of the file?

Well, I could only bring it down to 12.6 KB. I think you should remove unwanted lines of code.

1 Like

That basically much of your file does pretty URLs (clean URLs)

If it was WordPress then I would suggest you do it through it - but it doesn’t seem to be.

You also need to know your site and your wishes
so let’s say pretty URLs may not matter for the forum/s
or for some other segments e.g. events or movies
so such parts that are less important to you can be thrown out.


I think you can delete this - because as far as I know, our servers enforce GZIP compression by default.
and I think you can’t influence that.

5 Likes

With so many rewrite rules for pretty URLs, it will be pretty hard to reduce the file size with minimal effort and functional changes.

Most CMS and framework don’t come with huge .htaccess files, because they handle all their routing through PHP. They commonly send all URLs to a general index.php file, and from there decide which page to load by looking at the request URL in the code.

Looking at your code, many URLs already go to index.php, but add the URL to the link1 parameter. If you could parse the REQUEST_URI instead of a URL parameter, you could get rid of 80%+ of your .htaccess file by just routing every unknown URL to index.php.

5 Likes

create a .htaccess file and then copy paste the HTTP requests in it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.