Questions tagged [.htaccess]

Questions about `.htaccess` files in Magento, used to configure the Apache webserver

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

var .htaccess not activating - cacheleak vulnerability

I recently ran a magereport.com scan on one of our magento sites and it reported a cacheleak vulnerability. In my var folder, there is an .htaccess file but it is not activating and the ...
0
votes
1answer
24 views

How to add the webp format in the mod_expires part of the .htaccess file?

I add this line but it is not taken into account because the browser inspector tells me that the cache is 2 days for webp images: ExpiresByType image/webp "access plus 1 month" I use Plesk with ...
0
votes
1answer
11 views

For Magento2 how to apply a redirect rewrite in .htaccess file for all URL's from .html to /

For Magento2 how to apply a rewrite in .htaccess for all URL's from .html to / URL structure. The M1 store has .html as the end, the new M2 store has / as the URL ending for all products and ...
0
votes
0answers
26 views

RewriteRule for media path in .htaccess Magento-2

I want add RewriteRule in .htaccess for media path: From: https://example.com/media/wysiwyg/Test_data_123.pdf To: https://example.com/pub/media/wysiwyg/Test_data_123.pdf I have tried with ...
0
votes
2answers
37 views

magento 1 , how block bad bots on htaccess file

my site is constantly visited by bots and very often I would like to block them because of them, the load on php-fpm on log apache files i have this
1
vote
1answer
1k views

How to prevent duplicate content issues caused by index.php in urls?

I've been trying to prevent our homepage from displaying as both www.domain.co.uk & www.domain.co.uk/index.php but now i've realised that every other page displays with /index.php in the url. ...
1
vote
2answers
1k views

Magento 2 Leverage Browser Caching for Images, CSS and JS not any effect

As in Magento 1 to increase the page speed score and Y-slow score we have used Leverage Browser Caching for Images, CSS and JS code in .htaccess file but same script in Magento2 is not working. ...
2
votes
2answers
432 views

Document root change help

I am using Magento 2.3.1 Open Source. I installed it from the .zip file in the public_html folder (I didn't know any better at the time) in my account at my web host, running on Apache. I did the ...
0
votes
1answer
2k views

Magento .htaccess Response for preflight has invalid HTTP status code 400

I am doing a rest call from Magento to Angular 2. I am facing this CORS issue and trying many workarounds but nothing seems to work. Figured out its server side issue and made the below changes in ...
1
vote
0answers
141 views

allow any php script instead of 404 page?

I am trying a new local development method on windows using magento 2 on vagrant on windows and it's up and running. Now I'm trying to add xdebug with PHPstorm but it's unable to "see" an uploaded ...
0
votes
0answers
24 views

Internal Server Error 500 after upgrade Magento version from 2.2.6 to 2.2.10

After I upgrade the Magento version from 2.2.6 to version 2.2.10, I get Internal Server Error 500 when I try to access the website. I tried multiple solutions for example (a) removing var folder and ...
6
votes
3answers
986 views

How to add another web app to a subdirectory within Magento?

We are running magento on our site www.xsmoke.com. The site is international, so we are using "/country code" - e.g.www.xsmoke.com/de/ etc. Now we would like to install wordpress in one of the ...
0
votes
3answers
623 views

Moved from http to https but include www in url

Trying to setup my site so that its on HTTPS AND includes the WWW in the URL. After a while of searching I found a few posts that helped me redirect to https: stackoverflow.com/questions/25527671/...
0
votes
0answers
144 views

CORS fix in .htaccess not working if website URL is without index.php in magento 1.9

Default my magento store is loading without index.php. Site is secured. for both there are rewrite rules in .htaccess file which are working fine. I have implemented following code in .htaccess ...
1
vote
2answers
182 views

“ERR_TOO_MANY_REDIRECTS” when turn on Cloudflare CDN possible .htaccess file issue

When I tried to turn on Cloudflare CDN, my site will get "ERR_TOO_MANY_REDIRECTS" error page (the site loads fine if I don't turn on Cloudflare CDN). I checked with the hosting provider, seems like ...
0
votes
2answers
136 views

How to forbid access to .htaccess File in Magento 2?

If I call the .htaccess file in the browser e.g. https://www.mycompany.com/.htaccess, then it is getting downloaded. Is there a way to fix this? I added this block to my .htaccess file, but it does ...
0
votes
0answers
29 views

Magento 2 firefox not redirecting from http to https

I have setup my ssl certificate and configured admin. Use secure URLs on storefront & Admin to YES When I do example.com in chrome to takes me to https://example.com but in Firefox it not taking ...
0
votes
0answers
18 views

Add new domain in new store view not work in magento 1.x

I created a new store view and new url. I config it in backend and add in htaccess like this SetEnvIf Host www\.my.web-abc\.com MAGE_RUN_CODE=berba_new SetEnvIf Host www\.my.web-abc\.com ...
0
votes
2answers
619 views

Magento 1.8.1.0 can't login to admin panel - htaccess/memcache suspected

I have recently setup one of my client's live site to local. And was unable to run it on local instantly just after modifying core_config_data and local.xml, then I opened .htaccess and found ########...
0
votes
1answer
27 views

All my directories are accessible magento 1

All my directories (except app/) and my root files (install.php, index.php,.gitignore...) are accessible to the users.. Is it a problem ? I need to create a .htaccess for each my directories ? Thanks ...
0
votes
2answers
49 views

Magento 2 url key includes SKU number, how to remove?

The big problem with Magento somehow amending the url key to include the SKU where /product-title-stec00778.html should be /product-title.html and the SKU is SKU STEC00778 Any ideas? Not ...
0
votes
2answers
225 views

Redirect all pages to homepage via .htaccess except backend

I've been trying to redirect all pages of my Magento website to homepage via .htaccess - except the backend, naturally. Currently, I'm using these rules and everything is working fine so far but I ...
2
votes
1answer
52 views

what is .htaccess file for in Magento, is it important in anyway?

I see this file in both Magento one and two, I would like to know what is its functionality in Magento because I have read some articles about it that explains that this .htaccess "file is a ...
0
votes
0answers
17 views

Redirect one https url to http

I have website running in https but for one url I want to run it on http instead of https when I used stackoverflow.com/questions/43597395/… then it is creating loop. How we can resolve this?
2
votes
2answers
434 views

.htaccess file in magento contains what?

I have my .htaccess contains the following: Mac OS X 2¢ÔATTRÔ˜<˜<com.apple.quarantineq/0002;5596b949;Safari;F9417E7F-EAFC-41E0-BA60-E4E5FB339DEA I don't know if this file is should be like ...
0
votes
1answer
27 views

Htaccess file erased

I needed to add a line of code to my htaccess file so I downloaded it by FTP using Filezilla to my local machine I now see that the size of the htaccess file on the server is now 0 while the one I ...
1
vote
0answers
184 views

How to redirect default store view to en?

I've got a store with 2 stores, one with 2 languages and the other just 1. So: Website > Store1 > English (www.site.com/en) Website > Store1 > French (www.site.com/fr) Website > Store2 >...
1
vote
1answer
110 views

Redirect 301 removing parameters in URL by .htaccess

In the file .htaccess in magento, I want to redirect a url with parameters. An example is this: https://example.com/presente/decoracao/teu-sorriso?PageSpeed=noscript I need to redirect this to the ...
2
votes
1answer
689 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
117 views

Remove '.php' from url redirect [closed]

I have an URL like: base_url/cloths/mens.php now when we click on this above URL then it should redirect to: base_url/wp/cloths/mens/ here we want to remove .php extension from URL after ...
1
vote
0answers
73 views

Magento 2 - how do i redirect “mydomain/pub” and “mydomain/pub/media” path to homepage?

I'm trying to redirect "mydomain.com/pub" and "www.mydomain.com/pub/media" to homepage (mydomain.com). Currently, "mydomain.com/pub" path shows the homepage with no css and js loaded, and "www....
0
votes
1answer
480 views

Rewrite rule for media images

we need to set rewrite rule for some images in Magento 2.2.5 using .htaccess rules or nginx conf Example 1 Request Path: https://www.example.com//media/catalog/product/cache/1/thumbnail/543x403/...
1
vote
1answer
351 views

Caching css files in Magento

Because of the Black Friday, I've added some products as an offer. They can be shown on the main page with a block I had initially hidden with some CSS on my styles.css file. This morning, I removed ...
1
vote
1answer
3k views

Magento 2 .htaccess file missing in pub folder

I was recently trying to upgrade my Magento 2.2.7 to Magento 2.3.0 and the following message came up in component dependencies Found non-writable path(s): /var/www/vhosts/powermyself.com/httpdocs/pub/...
1
vote
1answer
25 views

.htaccess redirect samplesitex.com to samplesitey/alias-page in both https and http variants

I am trying to redirect an alias url to a different url path. (it wont let me do this in cpanel for some reason) Example: SiteX.com > SiteY.com/this-page I have tried RewriteCond %{HTTP_HOST} ^...
1
vote
2answers
135 views

Why is Magento admin URL so long and complicated on lcoalhost?

I have just uploaded Magento on localhost and its URL is simply this localhost/magento but when I go on its admin part i.e localhost/magento/admin part url redirects to a very complicated & ...
0
votes
1answer
65 views

other website/store/store front does not load; .htaccess file is missing

Magento 1.9.1 Porto theme My hosting company created a new account for me and moved my existing account there. That replaced the broken cPanel account and I am now able to access the database via the ...
1
vote
4answers
13k views

How to restrict specfic ip address to access magento site in .htaccess file in magento?

I have an idea below text in .htaccess file in magento root folder. Order allow,deny tells your web server that the Allow rules are processed before the Deny rules. Order deny, allow means that the ...
0
votes
1answer
608 views

This page isn’t working hotandbold.com redirected you too many times

My Magento Backend URL is not working and fronted is working Properly. Backend Url:- http://hotandbold.com/staging/admin_jewellery/ Fronted Url:- http://hotandbold.com/staging/ Can You suggest me, ...
1
vote
0answers
28 views

Are the Magento 2.1.14 rewrite rules in htaccess file working properly?

In the default htaccess file in Magento 2.1 there are some RewriteCond's and RewriteRule's that are explained in the htaccess.sample file that comes with Magento 2.1. never rewrite for existing files,...
1
vote
1answer
911 views

404 Error when accessing image in pub/media

Ive been struggling with this for a few weeks now and dont seem to be getting anywhere. I have installed a module that reads images from a directory 'pub/media/import' however when I navigate to the ...
0
votes
1answer
316 views

Parse error INDEX.PHP for sub-directory

I have created new web site for language code with sub-directory and copying two files index.php and .htacess from the root to the individual sub-directory.Then edit index.php file as: define('...
1
vote
1answer
7k views

Redirecting HTTP to HTTPS?

I've read into this quite a bit but can't seem to find a solution. I'm trying to set it so whenever someone visits a link for my site (and for whatever reason they don't include https it redirects to ...
2
votes
1answer
251 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:...
1
vote
1answer
810 views

301 redirect some products, categories and cms pages from old domain to new domain

I have this situation: Site1.com (3 store views: en, it and de) Site2.com (1 store view) I need to redirect everything from site1.com (only en store view which is default) to site2.com. ...
0
votes
1answer
2k views

While import/Export attributes get 500 internal server error [closed]

I am working on magento-1.9.2.1. I want to import and export attributes. for this, When I goto system ->import/export ->attributes ->import or export. I got following Internal server error. ...
2
votes
1answer
1k views

Magento replacing .htaccess file in root directory?

Magento replacing my custom .htaccess file? every time my home page lands in : page is not redirecting. the url was www.example.com/errors/503.php i would like to make clear there was no maintenance....
4
votes
3answers
124 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 ...
15
votes
6answers
37k views

Local installation of Magento 2 doest not generate files in the pub/static folder

I've just installed Magento 2 Community Edition with sample data (downloaded from their website and not installed with composer) locally via MAMP. The installation process was succesful, but all files ...
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 ...