Questions tagged [htaccess]

Denotes questions related to htaccess. A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, used for configuration of site-access issues, such as URL redirection, URL shortening, Access-security control (for different webpages and files), and more.

Filter by
Sorted by
Tagged with
15
votes
4answers
25k views

PageSpeed - Eliminate render-blocking JavaScript and CSS in above-the-fold content

I am running magento 1.9, and I am using the RWD slider that comes with Magento 1.9 on the home page. Google's PageSpeed doesn't like this and says: Eliminate render-blocking JavaScript and CSS ...
12
votes
1answer
18k views

How to enable Gzip compression?

I need to setup Gzip compression for a Magento project. I have tried many code in the .htaccess file in my project, but weren't able to enable Gzip. Please give me the right solution.
10
votes
5answers
15k views

Restrict access to admin area by IP

What is the best way to restrict the access to the admin area by IP in Magento? Bear in mind that admin can work either from /admin or index.php/admin
6
votes
3answers
9k views

Admin not saving changes

I've seen a lot of people with similar issues, but none of the many resolutions I've seen online have worked for my situation. Magento 1.8 Community Edition. Admin changes are not being saved. ...
6
votes
2answers
4k views

Redirect www to non-www keeping the path

In my .htaccess, the redirect from "www.example.com" to "example.com" works. But when the urls is "www.example.com/someotherpath.html" the redirect is still "example.com" How to solve this? I am ...
5
votes
2answers
1k views

How to secure Magento version control systems

Magento version control systems such as Git and Subversion store their metadata in hidden folders. Someone access my directory and mail me. I think I am not protecting my GIT. can anyone tell me how ...
5
votes
1answer
2k views

Magento rewrite category/product URLs leading to 404 page

I have many category and product URLs coming from google which gives 404 errors. The reason is google has indexed most of the pages without .html (from old site) while now I have all the pages with ....
4
votes
5answers
57k views

Getting 404 Not Found Error on every page except index.php [closed]

Because of some reason my site stopped working. After that I have uploaded the backup which I had created earlier. I am getting a "404 Not Found Error The resource requested could not be found on ...
4
votes
2answers
282 views

How to block cpanel link of my magento site

I had created an ecommerce website named http://example.com. I want to block my cpanel link for users who are accessing my website. Link is example.com/cpanel. If any I.T. specialist user or general ...
4
votes
3answers
9k views

Set individual image cache/expire date

I have a question regarding the image caching and although I am not quite sure, if Magento SE is the right place for this kind of question, but I thought it would be interesting for others to know as ...
4
votes
2answers
165 views

404 media urls in Fire Bug

I am getting lots of 404 errors in Fire Bug's Net tab. I have attached the screen shot to know more. The error gets continuously incremented in Fire Bug. I have checked for this and getting solutions ...
4
votes
3answers
122 views

alias for login page as /accounts

We have a magento website on /store folder. Idea is, on root folder, index.php will have company website. /store folder will have magento folder. Idea is, www.example.com/account should load login ...
4
votes
1answer
614 views

Case insensitive product urls

Does anyone have a good solution for making magento products' URLs case insensitive? Obviously I've looked into: <IfModule mod_speling.c> CheckCaseOnly on CheckSpelling on </...
4
votes
0answers
11k views

What is the optimal setting for max_execution_time? [closed]

I'm looking at improving our server performance, and noticed that the stock EE .htaccess file sets the max_execution_time to 18000, which really seems like a typo. 18000 seconds is 5 hours. Should ...
3
votes
4answers
15k views

best magento htaccess for performance

we have installed several extensions and bits and pieces of code to optimize Magento htaccess. Now I see the code has gotte quite long and I am not sure this is all conflicting or supporting ... So ...
3
votes
2answers
5k views

htaccess redirect https to http except specific pages

I want to redirect https to http for almost all pages, except for checkout, cart and account. Especially to improve speed. How do I define that inside my htaccess? All my rewrite rules in htaccess: ...
3
votes
3answers
856 views

SSL https:// to https://www. redirect before privacy warning Magento

I have just installed SSL on a server and am now trying to install it in Magento. I've put the base urls in SSL mode, and also changed the http:// to https:// to always use SSL even on product pages ...
3
votes
3answers
5k views

Magento 2 Multistore is not working with multi domain

I am facing issue while creating multi store in magento 2. I have added 2 store abc and xyz, each points to different domain. I have added suggested code from different sites. In index.php I added ...
3
votes
2answers
258 views

How to create wild card sub domain in Magento 1.9.x

I am coming with question of how to create a wildcard subdomain in Magento 1.9.x without using store view. I know creating more store view will cause the issues in price indexing, flat tables, etc., ...
3
votes
2answers
555 views

magento subfolder protect apache

I have some subfolders in my Magento DocumentRoot like /vendor/ and /media/ this folders are not protected and are reachable from the web for everyone. Now I want to protect these folders through ...
3
votes
3answers
3k views

subdomain redirects to main domain

I'm Trying to setup a subdomain with a copy of the main site so I can test things out. I created the subdomain and the necessary zone records Copied the site to the subdomain directory (which is at ...
3
votes
1answer
613 views

301-Redirects non-www to www

I have website where all links http://example.com/PRODUCTPAGE redirect to http://www.example.com It´s always missing the path after the domain name in my case the productpage. I know this is partly ...
3
votes
2answers
139 views

How can I hide directory listing for hacker

My site build with Magento 1.9.3.4. someone sends me a mail with an attached image which is my listed directory. My question is how they fetch this. Did any setting to avoid this type of access.
3
votes
1answer
2k views

Magento 2: Server unable to read htaccess file, denying access to be safe

My Magento 2 development system started, at (seemingly) random, to display the following error for all my frontend JS files Server unable to read htaccess file, denying access to be safe This ...
3
votes
1answer
517 views

Move store from Apache to Nginx server [duplicate]

I'm planning on moving my Magento store from one server to another. The current server is an Apache server and I just got notified the new webserver will be an Nginx server. The hosting company noted ...
2
votes
6answers
27k views

Magento 1.9 - .htaccess file missing

I have a problem with the .htaccess file in the root category of my server. It is not there. I searched for hours (google), but i haven't found any solutions. (Magento 1.9) I activated "display ...
2
votes
3answers
3k views

How to Block RSS in .htaccess?

I need to block RSS pages in htaccess, most importantly these /rss/catalog/new /rss/catalog/notifystock and /index.phprss/catalog/notifystock Especially the last one, as you can see it's /index....
2
votes
4answers
10k views

Remove parent categories from subcategory URLs

I realise similar questions have been posed before, but I have an additional caveat when I ask the following question. How can Magento URLs be rewritten such that: http://www.example.com/category/...
2
votes
2answers
9k views

Gzip Comporession and leverage Browser Cache Not working

i am trying to optimize my store. to optimize it i have added Gzip Code and Leverage Browser Cache Code in .htaccess File. There are 2 .htaccess file on my server. one is .htaccess and second is ....
2
votes
1answer
2k views

Protect Magento Directories

I am just about to put a Magento site live and wondered what the best method is to protecting Magento's directories. At the moment I have simply stuck in the following into my htaccess RewriteRule ^(...
2
votes
4answers
17k views

Magento secure and unsecure url redirection issue

I am facing issue regarding redirection. My system has been already live.Google already cached all pages with https . In past my secure url and unsecured were both https://www.example.com. But now ...
2
votes
1answer
3k views

Permission Denied htaccess in folders where no htaccess file even exists

This permissions issue comes up in the server log. It doesn't stop the site from loading but it does stop a lot of the site from functioning. Some things I did fix through permissions but things like ...
2
votes
1answer
404 views

Using htaccess to block visitors

We have seen a large increase in "spam" visitors from sites such as the below. Which is impacting our analytics and while I know we can block it from reporting, we are concerned it will affect our ...
2
votes
1answer
1k views

Why do special characters in search terms are processed as encoded characters (only on Production Server)?

This issue only happens once the site has been deployed to Production Server. On Development Environment works as expected. Using Magento 1.6.2.0 CE, Locale: español (Spanish) Search works just ...
2
votes
5answers
854 views

How to remove index.php from url if we enter manually

How to remove index.php when we enter manually in the URL My store path is /var/www/html/testfolder/ Thanks
2
votes
1answer
963 views

Multiple URL Redirect to HTTPS

I'm sure this is simple, but I can't quite work it out. My Magento website has several (duplicate) URL's: http://www.example.com http://www.example.com/index.php/ https://www.example.com/ https://...
2
votes
1answer
248 views

Magento no www. and a www. url

my magento website works only without www prefix, is there a way to access to my store with www prefix and without it at the same time? I have disabled url rewrite options. This is my .htaccess file:...
2
votes
2answers
8k views

Magento htaccess error

I have three website to be uploaded on single server. The server admin has set it up as. 1) The main website to be put on root folder 2) two subfolders are made in which i have to put other two ...
2
votes
2answers
101 views

How to restrict direct access `/pub` with url?

How to restrict direct access /pub with the project URL (www.domain.com/pub) in Magento 2.
2
votes
2answers
3k views

Changes in root .htaccess file not reflecting in Magento 2

I am using Magento 2.1. I am trying to add a rewrite rule in .htaccess file for url's starting with index.php?route=. to be replaced with the query string. RewriteCond %{QUERY_STRING} ^index.php?...
2
votes
2answers
47 views

Magento URl Handling?

I have created the new magento site and importing the data from the old site but I have the problem with the URLs. Old site URL starts from www.sitename.com but in my new site it starts from sitename....
2
votes
2answers
2k views

How can I disable access to local.xml and config.xml for external visitors?

I problem that anybody from web can observe my file local.xml and config.xml I enabled Deny From all in htaccess file in folder app and direct access have been disabled for all files in this folder ...
2
votes
1answer
3k views

Strange .htaccess and base URL redirect happening

I have an odd scenario that I cannot figure out. When Auto-redirect to Base URL is set to 301 or 302, the homepage of my website redirects correctly to what I have defined as my base URL (I am using ...
2
votes
1answer
162 views

Same Magento 2 htaccess file but different results on local machine and live server

I am running Magento 2.1.14 and have a version installed on my local machine as well as a live server. Both machines are running Apache 2.2. On my local machine I installed php 7.0.31 and on the ...
2
votes
1answer
972 views

IP whitelisting according to new Magento best practices

Recently Magento updated the post: "Protect your Magento Installation from Password Guessing", see: https://magento.com/security/best-practices/protect-your-magento-installation-password-guessing-new-...
2
votes
1answer
609 views

Magento Secure Magmi from unauthorized access using htaccess

I'm using below htaccess file to prevent unauthorized access to Magmi. /{root_path}/{magmi_dir}/.htaccess Order deny,allow Deny from all Allow from 127.0.0.1 202.131.115.180 xxx.xxx.xxx.xxx this ...
2
votes
1answer
2k views

Magento url rewrite issues - all pages without www redirect to homepage

Every page without w w w redirects to the homepage. Pages work normally with the w w w & the homepage redirects from non w w w to w w w. (I want w w w only on the website) I have tried changing ...
2
votes
3answers
3k views

Multiple Domains, multiple Store View and redirect

I have 2 different domains (www.mysite.com and www.mysite.it) associated at 2 different Store View (code=en and code=it). After set from backend my Magento 1.9.0.1 to works with different domains, I ...
2
votes
1answer
787 views

Magento 1.9 local.xml security warning

I'm trying to setup Magento 1.9.0.1 under Apache 2.4.9 without the access_compat module. As of Apache 2.4 the old access control directives are deprecated [1] and should no longer be used. I'm now ...
2
votes
0answers
34 views

www.domain.com/pub/ shows the web page without css/javascript loaded

I can access my site correctly like www.domain.com ( with all the content loads correctly), but if I type in www.domain.com/pub/ it is still accessible ( without js & css loaded). How do I fix ...