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
0
votes
2answers
19 views

How to redirect domain.com to www.domain.com?

I have this code in .htaccess Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] But it still appears ...
0
votes
3answers
3k views

Magento 2.2 .htaccess issue

I am just migrating my site from wwww.example.com to www.example.com/demo. Now problem is that CSS is not loading and any URL does not work. Please let me know if any issue in the .htaccess. #########...
1
vote
1answer
937 views

Help me on CORS Access Control Allow Origin

I have one domain having mywebsite.com and there would be multiple subdomains like subdomain.mywebsite.com , subdomain1.mywebsite.com , subdomain2.mywebsite.com and so on. In htaccess file I have ...
0
votes
1answer
2k views

Admin Login redirecting after login

I have cloned my 1.9.1 install to a subdomain successfully. However an odd behavior is occurring. When I attempt to login to the admin, the page reloads, the login fields are blank, and I noticed ...
0
votes
1answer
2k views

magento htaccess allow access specific folder

I want to access a folder in root directory in Magento like example.com/foldername but i got a blank page. So my question: how i can allow access specific folder in root directory in Magento using ...
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. ...
0
votes
1answer
1k views

SSL Magento 1.9 but receiving Your web server is configured incorrectly

I successfully implemented SSL on our website and went the LetsEncrypt to get my CA. All is set properly and in working order except one weird issue I am encountering post enabling. Your web server ...
0
votes
1answer
988 views

Magento 2 : Mixed Content Error Block HTTP Request an HTTPS page

When I call the third party HTTP URL in my page. Then, I face the below error. How can I solve it? Mixed Content: The page at 'https://*******************' was loaded over HTTPS, but requested an ...
0
votes
0answers
34 views

Magento 2.4 500 Error On Fresh Install

I have just installed a clean instance of Magento 2.4 running on PHP 7.4.9 and I am getting a 500 error when trying to access the index file to connect the database and compete the install. I have ...
0
votes
3answers
33 views

Magento 2.3 Site Unwanted Redirect

My Magento 2.3 site is redirecting and I am unsure why. When I access the domain, it redirects to domain.com/Industrial%20Cleaning%20Products. I have done the following to try and rectify the issue: ...
0
votes
0answers
24 views

Magento 2 How to fix Error site has been blocked by CORS policy

I have Developed a custom API its working fine in Postman, but its not working in another platform. How to fix this issue. I tried by updating root .htaccess RewriteEngine on RewriteCond %{...
1
vote
1answer
1k views

401 unauthorized due to directory protection on magento 2 project

Is there a way to pass basic authorization and bearer authorization in postman for accessing Magento 2 rest api's. I have defined the directory protection using .htaccess and .htpassword. For getting ...
0
votes
1answer
1k views

How to secure Magento 2 dev site using .htaccess

Previously using Magento 1 I have been able to secure dev sites easily using a .htaccess / .htpasswd setup. It's just to keep the site from being viewed before it's ready. However the same setup in ...
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
0answers
20 views

How to proxy media folder to live site

I'm working on a Magento site locally and would like to see the media folder contents to get a good representation of how the website looks. But the media folder is 124GB. For local development I'd ...
0
votes
0answers
30 views

Magento 2 Which .htaccess file to use for mod_expires.c (Leverage Browser Caching)?

In Magento 2 there are many .htaccess files in different locations. If I want to add the below code to my .htaccess file to increase the Leverage Browser Cacheing score, in which specific .htaccess ...
0
votes
0answers
7 views

Installing magento2 ina subdirectory give me eternal loops in the admin

How can I have magento2 in a subdirectory in a reseller with cpanel. I have the domain pointing public_html but my magento instance have to be in public_html/src I put the following code in the ....
4
votes
2answers
347 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
11k 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 ...
0
votes
0answers
7 views

404 redirect for my website using htaccess not working for new pages with “?”

How can I redirect my 404 pages with Magento? I try to change my site
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. ...
1
vote
1answer
42 views

Cannot whitelist htaccess blocked admin URL

Trying to whitelist the blocked admin URL for the outside world from htaccess but not working. The below code worked in Magento 1. I have added this in my root_directory/pub/.httaccess. RewriteCond %{...
0
votes
1answer
66 views

Magento 1.9 webp images rewrite htaccess

I can't figure out why my htaccess won't rewrite urls to webp images, only images that are on skin directory get served as webp. https://domain/skin/frontend/theme/test/images/image.png will be ...
0
votes
0answers
24 views

Magento 2.3 multilanguage error 404 with folder named as language suffix

Magento 2.3.5 multilingual site hosted on vps with plesk, I would like to create folders where to save the sitemaps of the site, where each folder must have the suffix of the language as its name. But ...
0
votes
1answer
25 views

Block traffic from USA but allow Google, Bing bots and Facebook catalogue uploads

I recently suffered 2 credit card attacks on my live site with traffic on the first attack coming from Singapore and on the second it came via the USA from someone in Vietnam. By card attacks I mean ...
0
votes
1answer
111 views

rewrite query string via htaccess

I want to rewrite some dynamic urls like: https://www.test.com/my-custom-url.html/?o=price&dir=asc&new=1 to https://www.test.com/my-custom-url.html/o/price/dir/asc/new/1 Thanks.
0
votes
1answer
48 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
111 views

What does “ExpiresByType text/HTML A0” and “ExpiresByType text/plain A0” on Magento htaccess file?

I want to activate the browser cache, for now here is my code: <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "...
0
votes
0answers
12 views

Magento 1 does not generate cache in the subdomain

I moved the media, skin and js folders to the subdomain of my site. So now the resources in magento are called with this address: subdomain.mysite.com Everything works and the addresses are taken ...
0
votes
1answer
44 views

Magento2 images not loading

I am new to magento, I am building a store in this I have deployed the site in the domain.com/shop subfolder, now the problem is that the images are not loading in my site, I think it is due to ....
1
vote
4answers
4k views

How to remove trailing slash from Magento 2 url

I have installed ssl in my Magento 2 store and configured base url to the https version. But when accessing http version, Magento redirecting url with appending trailing slash. For example: My ...
2
votes
1answer
2k views

Magento2: Different domain for each store view

I'm struggling to get my magento2 website set up on different domains for each storeview and was wondering whether anyone could please advise how I can get this working? I've created my store views ...
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 ...
0
votes
1answer
93 views

How to remove trailing slash adding in pagination urls

I have added code in my htaccess to add trailing slash in my Magento 2.3.2 website URLs. I want to exclude the pagination pages including questions to add a trailing slash. For example - I have ...
1
vote
2answers
64 views

Magento2 .htaccess

I want to redirect another url. https://example.com/store1/lstoreviewcode/ https://example.com/store2/cstoreviewcode/ to replace with https://example.com/store1/storeviewcode/ https://...
1
vote
1answer
323 views

How to improve Magento performance by eliminating Apache .htaccess files?

Our setup is a Magento 2.3.3 store running on a dedicated (not shared) Linux host. We have full root access and can edit files as needed. The httpd server is Apache 2.4.41. We have read several good ...
1
vote
0answers
31 views

Magento2 Seller Sub Domain Configuration

We are using multivendor marketplace in magento2. Now i we have login for seller as http://mystore.com/marketplace/vendor/login , I want to make it as seller.mystore.com that means when ever seller....
1
vote
2answers
1k views

redirecting magento install in subfolder to subdomain

I installed Magento in a sub-folder of my public HTML root but I cannot seem to get it to redirect from example.com/shop to shop.example.com. I have tried to change the .htaccess file in the sub-...
5
votes
1answer
694 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 </...
1
vote
3answers
53 views

Magento 2 Unable to redirect http to https when using multistore

I am unable to redirect HTTP to https when using a multistore option. Anyone else using more than one store and has the http->https auto redirection working from .htaccess?
0
votes
1answer
44 views

Magento 1.9.x migration on VPS error 403

I have to migrate the site in magento 1.9.4.3, multilingual, from shared hosting to VPS. On shared hosting I use cPanel, while on VPS I will use Plesk. After a successful transfer trial I realized an ...
0
votes
1answer
173 views

How to remove .html suffix?

I have a running store with around 600 products and wanted to remove the HTML suffix from my URLs. I removed the HTML in the config and reindexed. All HTML pages are being redirected to the non-HTML ...
1
vote
2answers
429 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 ...
5
votes
5answers
63k 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 ...
1
vote
0answers
49 views

pub/static/.htaccess being ignored

Ive just started working on a Magento 2 site (2.1.9) and trying to add a 301 rewrite to pub/static/.htaccess so that when someone enters an old URL with index.php it removes the index.php with a 301 ...
1
vote
2answers
644 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 ########...
2
votes
1answer
1k views

Browser Language Redirection For Multi Language Stores In Magento 2

Anybody knows how to use the following piece of code? I want detect visitors browser language and than redirect for the right multi language store. Want to use subfolders (www.domain.com/en/), not ...
0
votes
1answer
120 views

Forbid access to a file by url but allow through browser

how can I prevent the user to access my /v folder in my website where I have some video, but allow them to be display on frontend thanks to the <\video> tag from HTML 5 ? I tried this and other ...
1
vote
1answer
182 views

Error 552 Disk Quota Exceeded - But it is not

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 ...
0
votes
1answer
37 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
2 3 4 5