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
0 answers
21 views

Magento 2.4.6 in subfolder on Apache2

Ok, lets see if this famous issue got some updates and solutions. Seen many questions about it, but no real solutions. I'm having a setup with two different systems in two subfolders, like this root ...
Relja's user avatar
  • 113
0 votes
0 answers
39 views

pub/media is not accessible

I have recently upgraded from magento 2.3 to 2.4 and my images are not loading getting 404 errors. I have followed this link as well. I have tried lots of the answers but nothing is working. here is ...
urfusion's user avatar
  • 346
0 votes
0 answers
15 views

Password protect whole Magento site running on Docker

I'm still finding my feet both in Magento and Docker. Can anyone suggest how I can password protect a whole Magento site running within Docker? I understand the best/easiest way to do this is to ...
CResults's user avatar
  • 105
0 votes
0 answers
122 views

htaccess rewrite rule magento 2.4.5 prepends pub/

I have got 2 rewrite rules which work, but pub/ is added to the url when i dont want that. I add the rules to pub/.htaccess. If i add them to the .htaccess in the magento root, nothing happens. The ...
Alex Smith's user avatar
1 vote
1 answer
43 views

Load magento via .htaccess RewriteRule

I've a very specific problem with magento. At first let me explain what the problem is. I load magento into an iFrame to integrate the store into a webpage. This works like charm until it comes to ...
Jeireff's user avatar
  • 11
0 votes
0 answers
139 views

Apply .htaccess rule for controller and cron

I have some long-running scripts that should bypass the "Connection Timeout" set up in LiteSpeed. I want to do it in the .htaccess file and it works if I apply this rule (*RewriteRule . - [E=...
Kloppo's user avatar
  • 95
0 votes
1 answer
579 views

Magento 2 - ONLY the admin page doesn't work

I have installed Magento 2 locally. I imported the database, changed the URL, and so on. Everything works fine - each subpage loads. Unfortunately, the admin doesn't work. The page just shows 404. ...
cristoferro061's user avatar
1 vote
1 answer
494 views

Magento 2 - New storeview redirects back to default store view - status code 302

I created a new storeview accessible under the URL app.example.com I added this to the .htaccess to set the MAGE_RUN_CODE Environment Variable to app if the URL app.example.com is called: SetEnv ...
Black's user avatar
  • 3,280
0 votes
1 answer
21 views

Display my images in ebay listings (or other website) .htaccess question

I have a Magento site (2.4.3) running on Ubuntu with Apache. I am creating eBay listings which are using images from the https://<mysite.com>/images folder. The images are not displayed. If I ...
brettstix's user avatar
1 vote
1 answer
3k views

How to increase max upload image size to 16M in Magento 2?

I modify the field values upload_max_filesize = 20M ,post_max_size = 20M and memory_limit = 2048Min the PHP.ini file of the server. I have to upload the banner images up to 16MB on the website but it ...
Manoj Jarial's user avatar
0 votes
1 answer
184 views

Magento adding .html in the middle of url after last category

I migrated all my products and categories (thousands) over from M1 to M2 and persevered all the URL writes. I have now found that if we modify a category in M2 it is adding a .html to the end of the ...
neit's user avatar
  • 63
1 vote
1 answer
1k views

Magento 2.4.2 on subfolder with Apache

Magento with 2.4.2 changed the location of the root and the index.php by set everything inside the pub folder. This causes a 404 problem in the case magento is not in the docroot and I cannot resolve ...
AntonioC's user avatar
  • 187
0 votes
1 answer
359 views

Error redirected you too many times upon trying to install Magento 2.4

I just downloaded latest version of Magento 2.4 and I am trying to install it on Namecheap hosting but upon entering the URL of my website in the browser to start the setup wizard, it keep re-loading. ...
LoveDroid's user avatar
2 votes
4 answers
1k views

Magento2.4.2 multi website setup not working

I have upgraded the Magento version from 2.3.3 to M2.4.2 now the main example.com working fine and example.com/wholesale | example.com/retail not working. I have copied .htaccess from pub to these ...
Arunendra's user avatar
  • 7,436
0 votes
1 answer
4k views

Apache configuration file for Magento 2.4

I have installed Magento 2.4 on Apache 2 sever running on Ubuntu 20.x When I try to load the magento root directory on browser, I get Not Found The requested URL was not found on this server. I have ...
Nocturnal's user avatar
  • 101
0 votes
2 answers
184 views

/index.php/rest/V1/modules File not found after upgrading to magento 2.4.2

after upgrading to 2.4.2 there is a problem with rest api the url /index.php/rest/V1/modules responds with "File not found" the url /rest/V1/modules works well https://magento-560832-1812590....
user94951's user avatar
2 votes
2 answers
5k views

The requested URL /pub/ was not found on this server. - Magento .htaccess problem

I have an problem about magento 2.4.2 Installed magento 2.4.2 using Composer-CLI. But I can't access magento homepage (http://localhost:8888/magento2) The requested URL /pub/ was not found on this ...
Said's user avatar
  • 21
0 votes
1 answer
715 views

Magento 2 - Set the maintenance mode with the custom page

I am about to make a server switch for my site https://www.magento2.com from Apache to Nginx and during for this operation i want set up maintenance mode. The server where I want to set up this mode ...
Jackom's user avatar
  • 473
0 votes
2 answers
236 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 ...
Maroun's user avatar
  • 1
0 votes
3 answers
133 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: ...
Petey88's user avatar
  • 47
0 votes
0 answers
872 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 %{...
Praveen Negimani's user avatar
1 vote
1 answer
238 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 %{...
Adarsh Khatri's user avatar
0 votes
1 answer
50 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 ...
wjp_bill's user avatar
  • 330
0 votes
1 answer
859 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.
Yogita's user avatar
  • 784
0 votes
1 answer
415 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 ...
MagentoMac's user avatar
  • 1,042
0 votes
1 answer
556 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 ...
ufo56's user avatar
  • 11
0 votes
1 answer
453 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 ....
adi's user avatar
  • 101
0 votes
1 answer
232 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 ...
chanchal's user avatar
  • 417
1 vote
2 answers
147 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://...
Anas Mansuri's user avatar
  • 2,627
1 vote
1 answer
821 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 ...
MountainX's user avatar
  • 240
2 votes
0 answers
59 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....
Dinesh's user avatar
  • 552
1 vote
3 answers
910 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?
Zoltan veress's user avatar
0 votes
1 answer
65 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 ...
Joso's user avatar
  • 317
0 votes
1 answer
304 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 ...
dksjhfg987t23's user avatar
2 votes
2 answers
1k 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 ...
Mage Explorer's user avatar
1 vote
0 answers
244 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 ...
Daly Design's user avatar
0 votes
1 answer
292 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 ...
Morgan Tartreau's user avatar
1 vote
1 answer
481 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 ...
Magentohelp's user avatar
0 votes
1 answer
77 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 ...
Magentohelp's user avatar
0 votes
1 answer
3k 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 ...
Dharmik Ponda's user avatar
0 votes
1 answer
263 views

How to redirect subdomain to subdomain?

I have a question for config url rewrite on .htaccess file. On my store have two language is English and German. I setup English with domain main.cocal and German is de.main.local. so for now I want ...
xanka's user avatar
  • 2,104
2 votes
0 answers
58 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 ...
Mage Explorer's user avatar
2 votes
0 answers
579 views

Removing AMP Pages from Magento

Google AMP is a massive failure. I have seen my engagement and click rates all go down atleast 30% across all my sites, and one site is down 50% from when I installed AMP. I have it now for 7 months ...
styzzz's user avatar
  • 736
1 vote
2 answers
115 views

Magento 2.1 Redirect through htaccess

I am unable to 301 redirect URL like baseurl/blog/international%20enviroguard%20re-branding%20-%20faqs/ to baseurl/blog/international-enviroguard-re-branding-faqs through htaccess. The page is ...
chanchal's user avatar
  • 417
2 votes
0 answers
172 views

Magento 2 EE remove url trailing slash through htaccess

I am using below code in htaccess to remove trailing slash in urls. But after adding this code my admin panel stops working and shows error - Too many redirects. I don't know whether to place this ...
chanchal's user avatar
  • 417
0 votes
0 answers
65 views

Want to show the Stores based on countries

I need to show the stores name like saudi / oman / dubai. Each stores have two store views (Arbic & English). I want to display these Stores according to their countries. For Example Saudi ...
Ask Xah's user avatar
  • 522
1 vote
0 answers
320 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....
Mage Explorer's user avatar
0 votes
2 answers
2k views

Why Magento2 not loading css and js files in local setup?

my root folder .htaccess file RewriteOptions inherit # php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php71” package as the default “PHP” programming language. <IfModule ...
prabhakaran7's user avatar
  • 1,077
0 votes
2 answers
1k views

Rewrite URL using GET params

I have a URL that looks like this: site.local/wheel-tyres/tyres.html?find=aprilia-af-1-futura-1989-4729&sid=T80yDaUX1a I'm trying to get it to look like this: site.local/wheel-tyres/tyres/...
treyBake's user avatar
  • 141
0 votes
0 answers
288 views

Access Magento Admin on Subdomain

I have a running store on Magento 2 which has multiple websites that I can access in the front end without any problems, for example: https://siteone.mymagestore.com https://sitetwo.mymagestore.com ...
Wolfack's user avatar
  • 291

1
2 3 4 5