14

I solve Remove render-blocking JavaScript issue on Magento-1.9.x as follows: <script src="filename.js"></script> Replace with Following: <script src="filename.js" defer></script> <script src="filename.js" async="async"></script> or <action method="addJs"><script>prototype/prototype.js</script></...


11

It sounds like a behavior which can happen if you do not have the ".htaccess" file by Magento or if the ".htaccess" file is messed up. Please try adding or replacing the current file with the default ".htaccess" file from Magento.


10

You could increase the memory_limit to the minimum recommended 256MB. Outside of that, there's no real performance improvement to be gained in editing your htaccess. The best htaccess is not having one at all. Move and/or rewrite your rules into your vhost definition in Apache and disable overrides. For highest performance use AllowOverride None ...


9

For the temporary solution I would suggest you the following step to perform Go to System ->Configuration On left hand side select General -> Web and under that you will find the Search Engines Optimization tab Use Web Server Rewrites => No I think your server does not having rewrite_module enable please check whether it is enabled or not. Also check that ...


9

You can place the following codes into your .htaccess file:- RewriteCond %{REQUEST_URI} ^/(index.php/)?admin/ [NC] RewriteCond %{REMOTE_ADDR} !^1\.1\.1\.1 RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=302,L] Where 1.1.1.1 is your IP address. * For the last line, make sure that there's no spacing between http:// and %{HTTP_HOST}/. StackExchange doesn't allow ...


9

Make sure mod_deflate is on in Apache. You can check by creating an info.php file and calling phpinfo();. It will output server PHP / Apache specs in the browser. Don't forget to remove it when you're done! Then add the following to your htaccess file <IfModule mod_php5.c> ## enable resulting html compression php_flag zlib.output_compression ...


7

I had the very same problem with MAGENTO 2.1.7 . After reading thousands (literally) of blogs, tutorials and websites I figured it out by sticking a few lines of code. 1 : Do not touch the .HTACCESS file. There's nothing to modify in there. 2 : Open INDEX.PHP and replace the following code $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER)...


6

First thing you need to understand is that: for a webserver, both the owner and normal site visitors are the same. There is no default mechanism to identify a "Site owner". To achieve your goals, you can do below: Cpanel: Restrict the cpanel access from one or more IPs only. Or run cpanel on a different port which the normal users can't guess. Hope this ...


6

By default, Magento2 has 4 routers Base > CMS > URL Rewrite > Default In your case, you should create a custom router. I can suggest you create a custom module and then create a custom router to solve your issue. You can do as the following steps: Create app/code/Vendor/Module/registration.php <?php \Magento\Framework\Component\...


5

Use following code in your .htaccess file which is in your Magento root directory <IfModule mod_headers.c> # YEAR <FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$"> Header set Cache-Control "max-age=29030400" </FilesMatch> # WEEK <FilesMatch "\.(js|css|swf|woff)$"> Header set Cache-Control "...


5

By default magento protects the folders that need protecting. For example in the var folder has its own .htaccess file with this content. Order deny,allow Deny from all So does the media/customer folder. and there may be others. So unless you deleted something there is no need to take special precautions for protecting folders.


5

This most likely is a file ownership issue. You probably upload the Magento files as another user and the web server user can't access the files. You have to change ownership so the webserver user owns the files. First, you need to find out what user your webserver runs under. If your running Ubuntu, it's usually www-data. In that case, you simply go to ...


5

In case anyone uses Nginx: location ~* ^/(index\.php/bcknd|bcknd) { allow 1.1.1.1; try_files $uri $uri/ /index.php?$args; location ~* \.php$ { try_files /dummy @proxy; } deny all; }


5

Based on the hints by Simon, here is what I have: 1) Make sure "Auto-redirect to Base URL = No". It was set to "yes", and causing the problem. 2) Put the below in the .htaccess: RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !...


5

Another solution to work while your site is under maintenance is: add a file to your root maintenance.flag add to your index this lines: after this $maintenanceFile = 'maintenance.flag'; add this $ip = $_SERVER['REMOTE_ADDR']; $allowed = array('127.0.0.1','Another IP'); // these are the IP's that are allowed to view the site if ((file_exists($...


5

The technique as described by "Mohan Gs" will not work here. Because of the js path /media/js/ it seems he uses js merging. That means, that all js files added by xml standard way <action method="addJs">... <action method="addItem"><type>js</type>.. will be merged in a big one to /media/js/<hash>.js. Magento core js ...


5

What you have so for should work pretty well. The actuall redirect part I've added below RewriteEngine On Options +FollowSymLinks RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} !^/customer/account/ RewriteCond %{REQUEST_URI} !^/checkout/ RewriteCond %{REQUEST_URI} !^/wishlist/ RewriteCond %{REQUEST_URI} !^/ebizautoresponder/ RewriteCond %{REQUEST_URI} !^...


5

Rule works on 1.7: RewriteCond %{REQUEST_URI} ^/(index.php/?)?rss/ [NC] RewriteCond %{REMOTE_ADDR} !^1.1.1.1 RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=302,L] The rule below is the rule Magento instructions provide, it doesn't work. ############################################ ## make HTTPS env vars available for CGI mode SSLOptions StdEnvVars </...


5

Your problem is with .htaccess file. Take the .htaccess file from this git repo and put that file inside your Magento root directory Git Repo. Put this piece of code inside the .htaccess file. RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]


5

In .htaccess on your server config file. (1) RewriteEngine on RewriteRule "^(.*/)?\.git/" - [F,L] And (2) RedirectMatch 404 /\.git Place this both method in .htaccess file. It hides any file or directory whose name begins with .git Like .git directory or .gitignore file by returning a 404.


5

This problem is caused when apache's mod_version module is not enabled. Unfortunately, my host does not allow me to enable this module and so I have devised the following workaround: Step 1 Open [magento_root]/.htaccess with your favourite text editor. You will notice, towards the end of the file, there are numerous entries following this format: <...


4

Have you tried uploading a new version / copy from your original Magento 1.9 download? If you don't have this then grab another version via http://www.magentocommerce.com/download and see if that works.


4

I had this issue and in case anyone doesn't know the answer here it is, - the above code will also not allow checkouts or anything that requires index.php as the rule is not rewriting the index just removing it. Follow the already posted instructions by Amit Bera to ensure you are allowing rewrites in the config then change your htaccess file to reflex ...


4

The problem is that the synthax is not the same when there is variable in URL. Please try RewriteCond %{QUERY_STRING} ^format=ATOM$ RewriteRule ^Blog/post/feed/2013/06/20/NASA-Gets-In-On-the-Search-and-Rescue-Game-to-Further-Space-Exploration$ http://www.actuatorzone.com/blog? [L,R=301]


4

The first thing I noticed was that the search returns an 301 redirect with the HTTP header Content-Type: text/html; charset=iso-8859-1 and the wrong URL http://caserisimo.mx/catalogsearch/result?q=br%25C3%25B3coli. Your search result page has the correct UTF-8 content type. I guess you want to find out where that redirect is coming from.


4

Multiples are handled by adding another match line RewriteCond %{REQUEST_URI} ^/(index.php/)?admin(.*) [NC] RewriteCond %{REMOTE_ADDR} !^10\.1\.1\.10 RewriteCond %{REMOTE_ADDR} !^10\.2\.1\.10 RewriteRule .* - [F,L] Basically it translates to if this url regex, and not these addresses, then 403, you're out of here.


4

I'd simply create a subdomain eg (dev.mydomain.com) which directs to a different folder on your hosting (eg: dev) and develop on there? When you're ready to go live, edit the db core_config_data 'web/unsecure/base_url' and 'web/secure/base_url' values, delete or rename the var/cache folder and rename the directory (eg: dev => live) or to whatever the ...


4

This code says wait for the entire document to load, then load the external file defer.js. <script type="text/javascript"> function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "defer.js"; document.body.appendChild(element); } if (window.addEventListener) window....


4

Generally this things are referal spam trying to get clicks from appearing in your analytics. From what I know you can do few things: Filter these from Google Analytics/Piwik/any other tool you are using -> filters, Filter type: unstandard, exclude filter field referal: .*((darodar|priceg|semalt|buttons\-for\-website|makemoneyonline|blackhatworth|...


4

The web server user must have write access to the following files and directories: var app/etc pub Magento also recommends setting the permissions as follows: All directories have 770 permissions. 770 permissions give full control (that is, read/write/execute) to the owner and to the group and no permissions to anyone else. All files have 660 permissions....


Only top voted, non community-wiki answers of a minimum length are eligible