Posts tagged 'htaccess'
Set header conditionally if certain word present in the url - htaccess
You can set headers conditionally if certain word present in the URL using .htaccess. This can be completed by using the Header directive and the "IF" conditional directive.
401.shtml unauthorized error after htaccess http to https redirection
Strangely i have experienced 401.shtml unauthorized error after i have enabled http to https redirection through htaccess.
Serve svg images as svg instead of plain text
User agents such as browsers use media types to determine how the content should be processed. When a svg image is not served with correct MIME type in the content type header, It might not rendered as intended by the author.
Solved: Disable google weblight for your website
Google weblight is a google service, which shows the compressed view of the webpages listed in the search results when a slow network is detected. It removes websites default styles and js files, So user can view the webpage much quicker. But it can be disabled by setting cache control header to no transform.
Protect index files from hacking
Hacking is a very broad topic to discuss. Here I'm going to discuss about one kind of attack that is mainly targeted on website's index files
How to redirect from sub folder to root folder using htaccess
When we restructure website url, sometimes we need to redirect url from sub folder to root folder [ public_html ]. This can be done in two methods using htaccess.