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
40 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 ...
0 votes
0 answers
22 views

Problem with redirect link with %3C - 150084 Unencoded characters

While redirecting to link url dosen't gets encoded. Redirecting to - baseurl/lampfishtrapl/h:66_mbs-1122707503.html?amp=amp=<script%20src%3D%2F%2Flocalhost%2Fj60RDBXWh> On link hover it displays ...
0 votes
0 answers
26 views

Magento2.4.4 malware attack index.php and .htaccess auto generate

Hi everyone, Recently our website has been attacked and index.php and .htaccess are automatically created in pub directory. I have made backup of complete website and working fine on my local ...
0 votes
1 answer
24 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 ...
0 votes
0 answers
80 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=...
  • 95
0 votes
1 answer
289 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. ...
0 votes
1 answer
176 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 ...
  • 2,903
0 votes
1 answer
18 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 ...
0 votes
1 answer
1k 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 ...
0 votes
1 answer
154 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 ...
  • 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 ...
  • 187
0 votes
1 answer
296 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. ...
2 votes
4 answers
750 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 ...
  • 7,356
0 votes
1 answer
3k 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 ...
  • 101
0 votes
2 answers
176 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....
1 vote
2 answers
4k 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 ...
  • 11
0 votes
1 answer
448 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 ...
  • 417
0 votes
2 answers
145 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 ...
  • 1
0 votes
3 answers
69 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: ...
  • 47
0 votes
0 answers
607 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
1 answer
193 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
1 answer
41 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 ...
  • 320
0 votes
1 answer
702 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.
  • 784
0 votes
1 answer
353 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 ...
  • 1,032
0 votes
1 answer
440 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 ...
  • 11
0 votes
1 answer
306 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 ....
  • 101
0 votes
1 answer
185 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 ...
  • 397
1 vote
2 answers
88 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://...
  • 2,607
1 vote
1 answer
714 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 ...
  • 240
2 votes
0 answers
54 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....
  • 532
1 vote
3 answers
468 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
1 answer
59 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 ...
  • 317
0 votes
1 answer
285 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
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 ...
1 vote
0 answers
204 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 ...
0 votes
1 answer
224 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
1 answer
428 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
1 answer
70 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 ...
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 ...
0 votes
1 answer
238 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 ...
  • 2,064
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 ...
2 votes
0 answers
438 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 ...
  • 726
1 vote
2 answers
105 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 ...
  • 397
2 votes
0 answers
148 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 ...
  • 397
0 votes
0 answers
61 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 ...
  • 512
1 vote
0 answers
278 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
1 answer
1k 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 ...
  • 1,057
0 votes
2 answers
956 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/...
  • 131
0 votes
0 answers
268 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 ...
  • 283
0 votes
2 answers
1k views

Magento 2.2.x 500 internal server error upon installation

I have just installed magento 2.2.4 on my cPanel and I got internal server error 500. I tried to rename .htaccess file but then it opens with no css and its admin gives 404 error. My cPanel uses PHP 7....

1
2 3 4 5