Skip to main content

Questions tagged [.htaccess]

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

Filter by
Sorted by
Tagged with
17 votes
6 answers
46k 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 ...
Skovsgaard's user avatar
7 votes
1 answer
286 views

Magento Duplicate Content Issue .htaccess rewrite 301 forwarding

i have some issues with duplicate content on my website. in the past i had diverse stores setup and i disabled them but the urls seem to exist still. i would like to set up a forwarding rule example: ...
Mark's user avatar
  • 71
6 votes
3 answers
1k 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 ...
xsmoke.com's user avatar
4 votes
3 answers
159 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 ...
KuKu's user avatar
  • 99
4 votes
0 answers
84 views

Mobile browser is unable to load the XML data of Magento site [closed]

I am new to magento. My question here is that I am unable to load the XML data in mobile browser but with the same link i am able to display the xml data in Desktop browser . Data is coming out of ...
Sudhir Belagali's user avatar
3 votes
3 answers
13k views

Accidentally deleted .htaccess file inside pub/static folder

I accidentally deleted my .htaccess file. Before that I could just delete everything in the var and pub/static folder (except the .htaccess file of course) and just reload the page to see my CSS / ...
Dawesign's user avatar
  • 231
3 votes
5 answers
7k views

frontend and admin not working magento 2.4.2 upgrade

Frontend and admin doesn't work or show only 404 not found pages It is installed in a sub directory of root folder The development in command line everything works I can change the .htaccess file , it ...
Alain Stout's user avatar
3 votes
2 answers
6k views

htaccess redirect https to http except specific pages

I want to redirect https to http for almost all pages, except for checkout, cart and account. Especially to improve speed. How do I define that inside my htaccess? All my rewrite rules in htaccess: ...
JGeer's user avatar
  • 1,422
3 votes
1 answer
98 views

Tried everything to get index.php out of the URL and everything returns Not Found error

Things I've confirmed: Site is on Ubuntu 13.10 server at /var/www/mysite.com/htdocs/ Uncommented: /var/www/mysite.com/htdocs/.htaccess RewriteBase / Catalog URL Key = phones Desired URL for this ...
o_O's user avatar
  • 297
3 votes
1 answer
1k views

Magento under WordPress as subdirectory not working

I am using GoDaddy server. I have WordPress as root directory and i have setup Magento from local to server inside root as subdirectory. Magento home page is working fine,but when i try to open any ...
Urjit Gandhi's user avatar
2 votes
4 answers
12k 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/...
Chris Philpot's user avatar
2 votes
2 answers
615 views

Images not showing properly in email when site is password protected

My Magento development website is password protected through .htaccess and .htpasswd. I have a share via email feature in my website. On click of product share an email is sent with image of product. ...
Pradeep Sanku's user avatar
2 votes
3 answers
3k views

Magento HTACCESS query 301 redirect all but admin

Hi hopefully someone can help. I have added a 301 redirect to change from an old domain name to a new domain. The magento build is still on the old domain also (but with no follow / no index) I ...
Kelly3330's user avatar
2 votes
1 answer
4k 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 ...
Chad Sims's user avatar
2 votes
3 answers
11k views

How to resolve .htaccess not working on localhost? [closed]

I copy all files of my website for to run it on my PC, but when I want to see pages it doesn't work and show me the phpinfo(). I have .htaccess in root and this is the code of it but it doesn't work ...
Elham Gdz's user avatar
  • 605
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
2 votes
1 answer
169 views

my .htacces is empty

I would edit the .htaccess file, but there only was : Order deny,allow Deny from all that is normal? This file was in the subdirectory app , in the root directory there wasn't any file
Ali ATriple's user avatar
2 votes
1 answer
780 views

How to restrict admin access based on Role Created with IP?

I have created 2 separate roles under Permission -> Roles. 1). For Employees 2). For Suppliers I was wondering how to restrict Role: Employees to access admin area only from specific IP. We have ...
harry's user avatar
  • 197
2 votes
1 answer
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:...
pizzapie's user avatar
2 votes
2 answers
6k 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
  • 31
2 votes
1 answer
754 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 ...
Mr F8's user avatar
  • 77
2 votes
2 answers
467 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 ...
user27806's user avatar
2 votes
1 answer
823 views

Magento has become incredibly slow, timing out, errors, cpu abuse

I have been using Magento for around a month and it was never this troubled. I recently reinstalled it and put on a theme i bought, EM Gamewin. In order for this theme to work I needed to use the ...
Pr0ph3t's user avatar
  • 23
2 votes
1 answer
911 views

How do I set .htaccess so people can't see cron.sh and mage?

How do I set .htaccess so people can't see cron.sh and mage? I kind of feel like nobody should be able to get to anything except index.php from the outside. Yet Magento's default .htaccess file has ...
CommaToast's user avatar
2 votes
2 answers
2k 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 ...
Krang's user avatar
  • 167
2 votes
1 answer
797 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 ...
Shyam's user avatar
  • 1,690
2 votes
1 answer
125 views

How to rewrite a folder path

I need to create a redirect that will redirect from https://www.example.com/es to https://www.example.com/mx for all pages on my site. How would I go about that. Can I do that in Magento admin section?...
Freejoy's user avatar
  • 819
2 votes
1 answer
2k 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....
Vinay's user avatar
  • 21
2 votes
1 answer
157 views

What is the best way to re-write Catalog Search Results?

We currently have a site that serves search results like the following: http://www.domain.com/catalogsearch/result/?q=firstparam+otherparam+stuff Ideally, we'd like it to serve it via: /firstparam+...
Stech's user avatar
  • 89
2 votes
0 answers
439 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 ...
Barry's user avatar
  • 587
2 votes
1 answer
375 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 ...
groy's user avatar
  • 351
2 votes
2 answers
53 views

Magento Install issues

Hi I've installed Magento 2 in a directory : var/www/html/magento2 There seems to be two problems I'm experiencing: When I browse to http://....aws.com/ I can see contents of html folder and lists ...
Orange Juice Jones's user avatar
2 votes
0 answers
105 views

Magento 1.7 redirecting URLs when URL rewrite table empty and non in htaccess?

Im just cleaning up my site and sorting out all the 404s in webmaster tools. To fix the 404s I was just putting in a manual 301 in the htaccess file like this. Redirect 301 /football-rebounders/spot-...
user3914769's user avatar
2 votes
0 answers
576 views

How can I perform 301 url redirection in Magento 2.0?

URL structure has been changed for one of product page in my Magento 2.0 webstore. Now I need to perform 301 redirection to newly created URL. Is .htaccess still helpful here? If yes then please ...
Commerce Pundit's user avatar
2 votes
1 answer
487 views

htaccess redirect except backend

We are running a magento installatino with two websites. I have configured a .htaccess redirect with GeoIP in order to redirect visitors from one country to website number two. This works, however ...
Sparc's user avatar
  • 337
1 vote
1 answer
10k 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 ...
AspiringProgrammer's user avatar
1 vote
3 answers
15k 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 ...
sivakumar's user avatar
  • 307
1 vote
2 answers
2k views

Magento htaccess frontend authentication

Is it possible to block just frontend with htaccess? If I setup normal htaccess authentication to root then it block uploading images from admin. I'm aware there is IP blocking possibility but ...
Diamonte's user avatar
1 vote
2 answers
4k 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. ...
akgola's user avatar
  • 2,967
1 vote
2 answers
2k views

Htaccess - How can i make this redirect a 301 instead of 302?

My website redirects everything from http to https but 1 of the redirects is a none cacheable 302 redirect according to a few seo checkers i use. How can i get the following code to be a 301 redirect ...
David Smith's user avatar
1 vote
2 answers
2k views

Magento REST API / Apache and "Content-Type header is empty"

Has anyone noticed this error message "Content-Type header is empty" when POST-ing to Magento REST API? I'm using Postman for testing and very-very surely I'm sending the Content-Type header along ...
Sven's user avatar
  • 466
1 vote
2 answers
634 views

404 error magento

Hello everybody, I have just moved my magentoshop from localhost to a online server. I did everything you need to do like changing url in database and clear cache. Now i have a internal server error. ...
user3047147's user avatar
1 vote
1 answer
6k 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/...
CJNotts's user avatar
  • 412
1 vote
1 answer
868 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, ...
Kumar Vivek's user avatar
1 vote
2 answers
1k views

How can I add mod expires to htacess but still update site?

I am looking at ways of speeding up my Magento site. One way that comes up is to Leverage Browser Caching and Expires Headers. I found to add this to htaccess- <IfModule mod_expires.c> # ...
Tyler Jensen's user avatar
1 vote
1 answer
49 views

how can i change all urls of old website

i just remove my website from hmsaver.com to homemarket.ae now every thing is working but i want to ask is that possible if any visitor came from google to hmsaver.com and he redirect with same url to ...
ALI's user avatar
  • 11
1 vote
2 answers
167 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 & ...
Ashwani Kumar's user avatar
1 vote
1 answer
626 views

magento shop down by bots crawling

I have a problem with my magento store. Every now and then when a bot crawls my shop, the website goes down. I have made changes to robots.txt and .htacces. Also varnish is installed and a full page ...
user2995764's user avatar
1 vote
1 answer
3k views

SetEnv variable in .htaccess in magento

In .htaccess file in magento if SetEnv variable is set how this is processed in magento. For example: SetEnv MAGE_RUN_CODE store How does this works in magento index.php and displays the ...
Abinaya's user avatar
  • 161
1 vote
1 answer
121 views

/errors/ folder accessible?

I have noted that in default Magento .htaccess the /errors/ folder is accessible and open it in a browser list the content of the folder. How to address it ? Add Options -Indexes to the main ....
Fra's user avatar
  • 6,985