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
28k 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 ...
11
votes
5answers
16k 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
4
votes
3answers
7k views

Magento 2: Apache mod version not enabled/installed/allowed by host, causes 500 error on all pages due to failing .htaccess files

I created a fresh install of Magento 2.2.2 on a debian server using php7.1 and mysql 5.7. Once files were extracted, I was unable to access the setup wizard and received 500 errors from all pages. ...
7
votes
4answers
11k 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 ...
12
votes
1answer
19k 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.
2
votes
4answers
11k 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/...
6
votes
2answers
5k 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 ...
1
vote
3answers
3k views

Best option to have a holding page while developing

I am working on a new Magento site and have a "coming soon page" running (HTML/CSS/JS). This conflicts with the Magento setup and therefore it doesn't show (due to .htaccess redirecting everything to ...
3
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 ...
1
vote
3answers
5k views

htaccess Rewriterule to remove trailing slash

I ran a page seo and it said I needed to remove the trailing slash because it could cause duplicate content. So I found this rule: RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=...
1
vote
3answers
7k views

301 redirect http links to corresponding https links

We are using the SSL securing the whole site now. At the admin end, unsecure and secure URL are all in the form of https. Now the issue we are facing right now is, for example, the link "http://www....
0
votes
1answer
3k views

multi store view sitemap.xml url rewrite

I have magento multi store view installation with structure like this: example.com/it example.com/fr example.com/de I wan't to configure sitemap.xml for every store view. Sitemap.xml files are ...
1
vote
1answer
4k views

Unable to access magento without /index.php/ in the URL [duplicate]

I have fully downloaded a magento 1.9.1 instance and it's DB which was running on a server into my computer and trying to get it up and running using WAMP server. everything looks fine except that I ...
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 ...
1
vote
1answer
583 views

automatic generation of dir/files under pub/static not working

automatic generation of dir/files under pub/static not working. When i google about this find that i have to delete that file in which i did change and then run below given command. php bin/magento ...
1
vote
0answers
1k views

Implimenting a Content Security Policy Magento 1.9.x

I'm looking to improve the security of my site with a Content Security Policy. I have set one up for my site in htaccess (using Content-Security-Policy-Report-Only and doing everything possible to ...
1
vote
2answers
1k views

Redirect/rewrite home page domain.com to store view domain.com/en/

I have enabled Add Store Code to Urls to access the different store views of my Magento website, but now www.domain.com and www.domain.com/en/ have the same content. To avoid duplicate content I would ...
1
vote
2answers
1k views

Block access to system URLs through htaccess or some other way?

Is there a way to block access to the system URL's so a customer or bot would get a 404 or 403? I've done research into the rewrite rules and can't seem to find a way to mass rewrite the products' ...
0
votes
3answers
3k views

Install issue permission and htaccess

I'm trying to install Magento 2. I run this for permission file and folder chown -R admin:www-data /var/www/magento2 find /var/www/magento2 -type f -print0 | xargs -r0 chmod 640 find /var/www/...
0
votes
1answer
216 views

Magento 2: Rediection from Category page to CMS Page Without Changing URL

I have tried below in .htaccess which works fine I'm redirecting Category page to CMS Page Redirect /my-page/contact-us.html /contact Above works fine, but will change URL as it's Redirect. I don'...
0
votes
2answers
819 views

Product Page without www redirect to home instead of itself

If I type mysite.com/myproduct-name or mysite.it/myproduct-name without www it brings me to the respective homepage (I have 2 domains: www.mysite.com and www.mysite.it). .htaccess part: RewriteCond %...