.htaccess

why png size doesn't change after using http gzip compression

旧城冷巷雨未停 提交于 2020-01-10 12:12:21
问题 I use following .htaccess to set gzip compression: AddOutputFilterByType DEFLATE text/html image/png image/jpeg text/css text/javascript Please check this url: http://www.coinex.com/cn/silver_panda/proof/china_1984_27_gram_silver_panda_coin/ the gzip compression works for html, css, js and jpg, but not working for png (really amazing..) 回答1: PNG is already a compressed data format. Compressing it with GZIP is not likely to decrease the size, and can in fact make it larger. I'm surprised you

Exclude one folder in htaccess protected directory

巧了我就是萌 提交于 2020-01-10 09:36:15
问题 I have a directory protected by htaccess. Here is the code I use now: AuthName "Test Area" Require valid-user AuthUserFile "/***/.htpasswd" AuthType basic This is working fine. However, I now have a directory inside of this folder that I would like to allow anyone to access, but am not sure how to do it. I know that it is possible to just move the files outside of the protected directory, but to make a long story short the folder needs to stay inside the protected folder, but be accessible to

Exclude one folder in htaccess protected directory

倖福魔咒の 提交于 2020-01-10 09:34:03
问题 I have a directory protected by htaccess. Here is the code I use now: AuthName "Test Area" Require valid-user AuthUserFile "/***/.htpasswd" AuthType basic This is working fine. However, I now have a directory inside of this folder that I would like to allow anyone to access, but am not sure how to do it. I know that it is possible to just move the files outside of the protected directory, but to make a long story short the folder needs to stay inside the protected folder, but be accessible to

Remove .html from URLs with a redirect

走远了吗. 提交于 2020-01-10 09:04:13
问题 We have a website, unfortunately all the URLs have the .html suffix, its a Magento installation, Magento allows you to change this on the CMS, but again, unfortunately all this URLs with .html suffix have a good ranking in Google. We need to redirect to non .html . So, consider the following scenario, we are rebuilding this site from scratch, so we have the same urls on the new site but without the .html suffix. Now is: www.example.de/cool-shoes.html Will be: www.example.de/cool-shoes So www

.htaccess - how to remove repeated characters from url?

左心房为你撑大大i 提交于 2020-01-10 05:36:26
问题 I have the following url: example.com/hellllllllllo And I was looking for a way to avoid repeated characters up to double. Inspired by this question/answers Remove Characters from URL with htaccess I have created the following htaccess document to avoid repeated characters. If the character is repeated more than 23 times the url is not completely rewrited and I was wondering if there is any possible improvment? RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_URI} ^(.*)l{3,}(.*)$

Multiple 301 Redirect For Multiple Pages or URL

非 Y 不嫁゛ 提交于 2020-01-10 05:30:25
问题 I am redesigning my store and so the old structure has been changed with the new structure. So trying to redirect all old products with the new. I have more than 20-25 products and if I write redirect rule for every product than I have to write in this way Redirect 301 /store/products/somename/ http://store.domain.com/nicecar Redirect 301 /store/products/blabla/ http://store.domain.com/newpros Redirect 301 /store/products/cubacuba/ http://store.domain.com/illollo Which will become to long and

max_input_vars limited in PHP 5.2.17

不问归期 提交于 2020-01-10 03:51:47
问题 My hosting provider is using PHP 5.2.17 and I have problems with max_input_vars that is set to 1000 I am using Prestashop and translations are not working. I have tried to add to .htaccess: php_value max_input_vars 6000 php_value suhosin.post.max_vars 6000 php_value suhosin.request.max_vars 6000 And after that I cannot access my page, I get I get page not found error? Can you help me with this? Thanks 回答1: It should work, If you add php_value max_input_vars 6000 php_value suhosin.post.max

Serving images from outside of document root

时光毁灭记忆、已成空白 提交于 2020-01-10 03:44:08
问题 Is it possible? Let's say my directory structure looks like this: /data /data/images /public The document root is in the "public" directory. This won't work, of course: <img src="/../data/images/1.png" alt="" /> But maybe it's possible to enable serving images from directory above document root somehow? I would like to know. 回答1: The most common way is an Alias: Alias /data/ /wherever/your/data/are/ 回答2: Another way (say if you can't set an alias...) would be to use a script as the image

Simple problem with mod_rewrite in the Fat Free Framework

亡梦爱人 提交于 2020-01-10 03:03:18
问题 I am trying to setup and learn the Fat Free Framework for PHP. http://fatfree.sourceforge.net/ It's is fairly simple to setup and I am running it on my machine using MAMP. I was able to get the 'hello world' example running just fin: require_once 'path/to/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello, world!'; } F3::run(); But when I try to add in the second part, which has two routes: require_once 'F3/F3.php'; F3::route('GET /','home'); function home() { echo 'Hello,

Using .htaccess to set a sub directory as root directory [closed]

不想你离开。 提交于 2020-01-10 01:59:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Is there a way to use htaccess to tell a subdirectory to act as the root for the entire site? For example, if I had a website under http://localhost/testsite/ and in it's index.php file I had a reference to the stylesheet using the following code.. <link rel="stylesheet" type="text/css" href="/css/layout.css" />