Skip to content
Advertisement

Tag: .htaccess

htaccess misconfiguration 500

So basically i created a .htaccess file which removes .html extension and redirects /file.html to /file but when i write /file.html/ it causes a 500 internal server error, How can I map/file.html/ to my custom error page ? or simply redirect that also to /file.html Here is the code : Answer With your shown samples, could you please try following(comments

Get PHP $_SESSION data in .htaccess for LiteSpeed cache

I need to send data from $_SESSION from PHP file to .htaccess for setup Vary variable for setting LiteSpeed cache. PHP script example: .htaccess example I already tried these ways: Via cookies. I set PHP variable in the cookies and get it from there in .htaccess via “RewriteCond %{HTTP_COOKIE} (.*) [NC]”. But I will have also private data which I

How to list a directory content

How to access directory files when we don’t have index file. I used this htaccess code but it worked when I mention file but I want to show directory file without insert index file. Please check my htaccess code and tell me where i am wrong thanks Answer You can use the Options configuration option. The documentations presents Options by

How to force HTTP to HTTPS with an exception?

So I had to force all connections via HTTP to go to HTTPS on a specific folder (e.g. “public_html/folder1”). I found a tutorial somewhere and used the following in an .htaccess file: Problem is, I have a folder inside that folder1 which should be allowed to be accessed via HTTP and not just HTTPS, how do I make an exception?

Remove .htpasswd Password Protection .(Nginx)

I added an htpasswd.txt to sites-avaiable/default to protect my site: Now that i’m trying to remove it, I can’t get rid of a .htpasswd protection I set up previously. I’ve tried everything from creating .htaccess in the root of my site with satisfy any like this post suggests and this, to deleting the reference to htpasswd.txt from my sites-available/default file,

.htaccess RewriteRule keeping URL structure

My current rewrite rule: The result above works great so I can format the URL like domain.com/a/b/c I would like to add in a domain switch as well so the results I want is sub.domain.com/a/b/c when you access it using domain.com/a/b/c Currently here is what I have tried But the result of this is http://sub.domain.com/a=a&v=b&id=c and needs to be http://sub.domain.com/a/b/c

How much does using htaccess files slow down website performance (especially with solid state disks)?

The Apache docs say (http://httpd.apache.org/docs/2.4/howto/htaccess.html), “You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.” But that

Advertisement