Questions tagged [.htaccess]
Questions about `.htaccess` files in Magento, used to configure the Apache webserver
43
questions with no upvoted or accepted answers
2
votes
0answers
177 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 ...
2
votes
2answers
47 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 ...
2
votes
0answers
92 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-...
2
votes
0answers
567 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 ...
1
vote
0answers
284 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
0answers
91 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....
1
vote
1answer
27 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
0answers
41 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
0answers
1k views
Mysql server goes down with queries in SLEEP STATE when I access magento site
We have a Magento 1.9.2.4 site. We are accessing it on using a subfolder and subdomain as http://dummysite.com/magentosite and http://magentosite.dummysite.com
Here we would live to mention that our ...
1
vote
0answers
71 views
How avoid user authentication for one single url in htaccess?
SetEnvIf Request_URI "^/wp-content*$" AdminUri
AuthUserFile /public_html/.htpasswd
AuthType Basic
AuthName "My Secret Folder"
Require valid-user
I set up authentication in my site as above. I ...
1
vote
1answer
464 views
How to map a dynamic url to a function in controller
I'm creating a new magento module. The frontend name of the module is groupedproduct. Now i need to map a dynamic url to indexAction of the IndexController. For example the url will of the form http://...
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 ...
1
vote
0answers
71 views
Subfolder as Magento storeview
I am trying to access a store view in Magento 1.9.1.1 from a subfolder.
I have:
www.webshop1.nl => store_1 + default
www.webshop2.nl => store_2 + storeview_NL
www.webshop2.nl/en => store_2 +...
1
vote
2answers
642 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
########...
1
vote
0answers
157 views
Sub-domain Stores on Local Dev Server
I have a live Magento site with a main store and also white-label stores located on sub-domains, all running out of the same Magento website. I'm using .htaccess to direct sub-domains to the ...
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
0answers
42 views
Magento 1.8 - Very strange issues with redirects caused by our hosts tech support team
We asked our hosts tech support to change the 302 redirects to 301's...after numerous attempts by them i gave up on them and accepted that they could not do it.
Now they have left us where none of ...
1
vote
0answers
46 views
Picture generation does not work after URL redirect in .htaccess
Picture generation does not work after URL redirect in .htaccess with the following script:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{...
1
vote
0answers
195 views
Multi-website Setting
To setup multi-website store, I'm following this
https://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup
I think I did everything but Edit the .htaccess
As the ...
0
votes
1answer
28 views
Magento 2 - remove .html from URL by using .htaccess
We have some wrong URLs in our store ending with .html. If the user opens such a URL, then the .html should get removed, otherwise the site cant get found.
So I added this rule to my .htaccess file in ...
0
votes
0answers
9 views
Magento 2 - 404 page with no styling after migrating from localhost to server
I am a beginner to Magento 2. I have built a webshop locally without any problems. Now I want to host my webshop on a live server. After following multiple guides on how to do this and after fixing a ...
0
votes
0answers
13 views
CORS Header set Access-Control-Allow-Origin “*” not working for google fonts
I have this piece of code in my .htaccess file
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set X-UA-Compatible "IE=edge"
# `mod_headers` ...
0
votes
1answer
253 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
39 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
35 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
103 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
0
votes
0answers
28 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 ...
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
83 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
1answer
36 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
1answer
788 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/...
0
votes
2answers
166 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
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 ...
0
votes
2answers
275 views
Transferring magento website to sub domain gives 404 error but works fine on main domain
I have a magento (1.9.2.1) setup on a main domain ( www.mysite.com ) and now I want to transfer it from main domain to subdoamin like (sub.mysite.com).
Changed app/etc/local.xml file details
Cleared ...
0
votes
1answer
602 views
Magento 2.0.12, 404 error(whoops, our bad) on all pages except Home, after fresh installation
After doing a fresh installation of Magento 2.0.12.
I am getting "whoops, our bad" page for all pages except the homepage(index).
The homepage load fine but for all other pages/links , I m getting ...
0
votes
1answer
26 views
Force Trailling slash and problem with pop up
Hi I have found this code about the trailling slash and it works perfect.
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [L,R=301]
...
0
votes
0answers
19 views
Magento move through shell - after move index.php needed in urls
Strange issue, I do a backup of folder and database through shell.
I setup the new test shop in a subfolder, change the url etc. All good.
Cleared cache, did a reindex.
Weird issue, after the move ...
0
votes
0answers
2k views
Font from origin as been blocked from loading by Cross-Origin Resource Sharing policy on multiple websites magento
I have created two websites using one magento installation, like:
abc.com (original)
xyz.com (second domain)
Both are working fine except the fonts issue I got on sub domain (second website). Error ...
0
votes
1answer
74 views
Magento MultiStore Rewrite rules does not works
I have this code in .htaccess
RewriteCond %{HTTP_HOST} www\.fashionstudio\.ie [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:default]
RewriteCond %{HTTP_HOST} www\.fashionstudio\.ie [NC]
RewriteRule .* - [E=...
0
votes
0answers
48 views
Redirect magento site
I need to redirect the whole website to a specific url
i.e to
domain.com/customer/account/create.
using htaccess?
How I can do that. I tried the following stuff it it show redirection loop
...
0
votes
1answer
473 views
How to remove index.php in product view page?
For some reason i kept index.php in url but i want to remove index.php in Product individual page only.
My current url : https://domain.com/index.php/category-names/product-name.html
i want to this ...
0
votes
1answer
289 views
Want to remove index.php from the URL
Hi My site name is xpressbuyer.com.
I have tried almost all solution, but nothing seems to be working. Below things i have done.
Add code in .htaccess
Set Use Web Server Rewrites to YES in Search ...
0
votes
3answers
629 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/...