How do I block visitors from directly viewing images The Next CEO of Stack OverflowHow can I disable access to local.xml and config.xml for external visitors?Using htaccess to block visitorsHow to block all IP from accessing a page on web siteHow to block cpanel link of my magento siteHow to Block RSS in .htaccess?Remove block from Magento 2.2How to fetch the image from DB and display it , to frontend in magento 2how to call script from block argument?How to remove image url from sitemap.xml Magento 2?How to crop square images in Magento 2 using view.xml

What connection does MS Office have to Netscape Navigator?

Why do airplanes bank sharply to the right after air-to-air refueling?

What expression will give age in years in QGIS?

Why has the US not been more assertive in confronting Russia in recent years?

What is the purpose of the Evocation wizard's Potent Cantrip feature?

multiple labels for a single equation

How to avoid supervisors with prejudiced views?

How to make a variable always equal to the result of some calculations?

Indicator light circuit

If a black hole is created from light, can this black hole then move at speed of light?

Why does standard notation not preserve intervals (visually)

If the heap is initialized for security, then why is the stack uninitialized?

Contours of a clandestine nature

How to start emacs in "nothing" mode (`fundamental-mode`)

WOW air has ceased operation, can I get my tickets refunded?

How do I transpose the 1st and -1th levels of an arbitrarily nested array?

Would a completely good Muggle be able to use a wand?

How do I go from 300 unfinished/half written blog posts, to published posts?

What exact does MIB represent in SNMP? How is it different from OID?

Interfacing a button to MCU (and PC) with 50m long cable

Make solar eclipses exceedingly rare, but still have new moons

In excess I'm lethal

How to add tiny 0.5A 120V load to very remote split phase 240v 3 wire well house

Return the Closest Prime Number



How do I block visitors from directly viewing images



The Next CEO of Stack OverflowHow can I disable access to local.xml and config.xml for external visitors?Using htaccess to block visitorsHow to block all IP from accessing a page on web siteHow to block cpanel link of my magento siteHow to Block RSS in .htaccess?Remove block from Magento 2.2How to fetch the image from DB and display it , to frontend in magento 2how to call script from block argument?How to remove image url from sitemap.xml Magento 2?How to crop square images in Magento 2 using view.xml










0















I want to prevent visitors to the site from going to http//... ...img.jpg and viewing the image there and instead see them redirected land on the main page.
I have tried editing some the .htaccess files following online guides and references but all I have managed is to generate site wide 404 errors
I need one folder in particular covered but a site wide solution would be helpful too.



Running magento 2.2.7 if that helps










share|improve this question







New contributor




Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    0















    I want to prevent visitors to the site from going to http//... ...img.jpg and viewing the image there and instead see them redirected land on the main page.
    I have tried editing some the .htaccess files following online guides and references but all I have managed is to generate site wide 404 errors
    I need one folder in particular covered but a site wide solution would be helpful too.



    Running magento 2.2.7 if that helps










    share|improve this question







    New contributor




    Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      0












      0








      0








      I want to prevent visitors to the site from going to http//... ...img.jpg and viewing the image there and instead see them redirected land on the main page.
      I have tried editing some the .htaccess files following online guides and references but all I have managed is to generate site wide 404 errors
      I need one folder in particular covered but a site wide solution would be helpful too.



      Running magento 2.2.7 if that helps










      share|improve this question







      New contributor




      Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I want to prevent visitors to the site from going to http//... ...img.jpg and viewing the image there and instead see them redirected land on the main page.
      I have tried editing some the .htaccess files following online guides and references but all I have managed is to generate site wide 404 errors
      I need one folder in particular covered but a site wide solution would be helpful too.



      Running magento 2.2.7 if that helps







      magento2.2 htaccess image-url






      share|improve this question







      New contributor




      Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      ElganifElganif

      1




      1




      New contributor




      Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Elganif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Add in .htaccess file follwoing lines
          Here is a solution



          RewriteCond %HTTP_REFERER !^http://(www.)?domain.com/.*$ [NC]
          RewriteRule i/image_(d+).(jpg|jpeg|gif) pic/$1 [L]





          share|improve this answer























          • I tried this just now (and other variants of it from before) and it doesnt seem to work right. If i put it in the .htaccess in public_html then the entire site goes to server error and wont load, if i make a .htaccess where the files are it seems to have no effect at all. Can you clarify which file I add it to, or if theres some framing im missing? I have both with and without the 'RewriteEngine on' or the IFModule tags to no avail

            – Elganif
            yesterday











          • you have to add it in ifmodule tag

            – Ketan Borada
            18 hours ago











          • when adding these lines to the .htaccess at site root (with the other rewrite lines) it takes the entire site down (500 internal server error) There was no .htaccess in the directory I want to protect, but when I crate it and add these including the <IfModule mod_rewrite.c> and RewriteEngine on it seems to have no effect.

            – Elganif
            9 hours ago











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Elganif is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267708%2fhow-do-i-block-visitors-from-directly-viewing-images%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Add in .htaccess file follwoing lines
          Here is a solution



          RewriteCond %HTTP_REFERER !^http://(www.)?domain.com/.*$ [NC]
          RewriteRule i/image_(d+).(jpg|jpeg|gif) pic/$1 [L]





          share|improve this answer























          • I tried this just now (and other variants of it from before) and it doesnt seem to work right. If i put it in the .htaccess in public_html then the entire site goes to server error and wont load, if i make a .htaccess where the files are it seems to have no effect at all. Can you clarify which file I add it to, or if theres some framing im missing? I have both with and without the 'RewriteEngine on' or the IFModule tags to no avail

            – Elganif
            yesterday











          • you have to add it in ifmodule tag

            – Ketan Borada
            18 hours ago











          • when adding these lines to the .htaccess at site root (with the other rewrite lines) it takes the entire site down (500 internal server error) There was no .htaccess in the directory I want to protect, but when I crate it and add these including the <IfModule mod_rewrite.c> and RewriteEngine on it seems to have no effect.

            – Elganif
            9 hours ago















          0














          Add in .htaccess file follwoing lines
          Here is a solution



          RewriteCond %HTTP_REFERER !^http://(www.)?domain.com/.*$ [NC]
          RewriteRule i/image_(d+).(jpg|jpeg|gif) pic/$1 [L]





          share|improve this answer























          • I tried this just now (and other variants of it from before) and it doesnt seem to work right. If i put it in the .htaccess in public_html then the entire site goes to server error and wont load, if i make a .htaccess where the files are it seems to have no effect at all. Can you clarify which file I add it to, or if theres some framing im missing? I have both with and without the 'RewriteEngine on' or the IFModule tags to no avail

            – Elganif
            yesterday











          • you have to add it in ifmodule tag

            – Ketan Borada
            18 hours ago











          • when adding these lines to the .htaccess at site root (with the other rewrite lines) it takes the entire site down (500 internal server error) There was no .htaccess in the directory I want to protect, but when I crate it and add these including the <IfModule mod_rewrite.c> and RewriteEngine on it seems to have no effect.

            – Elganif
            9 hours ago













          0












          0








          0







          Add in .htaccess file follwoing lines
          Here is a solution



          RewriteCond %HTTP_REFERER !^http://(www.)?domain.com/.*$ [NC]
          RewriteRule i/image_(d+).(jpg|jpeg|gif) pic/$1 [L]





          share|improve this answer













          Add in .htaccess file follwoing lines
          Here is a solution



          RewriteCond %HTTP_REFERER !^http://(www.)?domain.com/.*$ [NC]
          RewriteRule i/image_(d+).(jpg|jpeg|gif) pic/$1 [L]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          Ketan BoradaKetan Borada

          386838




          386838












          • I tried this just now (and other variants of it from before) and it doesnt seem to work right. If i put it in the .htaccess in public_html then the entire site goes to server error and wont load, if i make a .htaccess where the files are it seems to have no effect at all. Can you clarify which file I add it to, or if theres some framing im missing? I have both with and without the 'RewriteEngine on' or the IFModule tags to no avail

            – Elganif
            yesterday











          • you have to add it in ifmodule tag

            – Ketan Borada
            18 hours ago











          • when adding these lines to the .htaccess at site root (with the other rewrite lines) it takes the entire site down (500 internal server error) There was no .htaccess in the directory I want to protect, but when I crate it and add these including the <IfModule mod_rewrite.c> and RewriteEngine on it seems to have no effect.

            – Elganif
            9 hours ago

















          • I tried this just now (and other variants of it from before) and it doesnt seem to work right. If i put it in the .htaccess in public_html then the entire site goes to server error and wont load, if i make a .htaccess where the files are it seems to have no effect at all. Can you clarify which file I add it to, or if theres some framing im missing? I have both with and without the 'RewriteEngine on' or the IFModule tags to no avail

            – Elganif
            yesterday











          • you have to add it in ifmodule tag

            – Ketan Borada
            18 hours ago











          • when adding these lines to the .htaccess at site root (with the other rewrite lines) it takes the entire site down (500 internal server error) There was no .htaccess in the directory I want to protect, but when I crate it and add these including the <IfModule mod_rewrite.c> and RewriteEngine on it seems to have no effect.

            – Elganif
            9 hours ago
















          I tried this just now (and other variants of it from before) and it doesnt seem to work right. If i put it in the .htaccess in public_html then the entire site goes to server error and wont load, if i make a .htaccess where the files are it seems to have no effect at all. Can you clarify which file I add it to, or if theres some framing im missing? I have both with and without the 'RewriteEngine on' or the IFModule tags to no avail

          – Elganif
          yesterday





          I tried this just now (and other variants of it from before) and it doesnt seem to work right. If i put it in the .htaccess in public_html then the entire site goes to server error and wont load, if i make a .htaccess where the files are it seems to have no effect at all. Can you clarify which file I add it to, or if theres some framing im missing? I have both with and without the 'RewriteEngine on' or the IFModule tags to no avail

          – Elganif
          yesterday













          you have to add it in ifmodule tag

          – Ketan Borada
          18 hours ago





          you have to add it in ifmodule tag

          – Ketan Borada
          18 hours ago













          when adding these lines to the .htaccess at site root (with the other rewrite lines) it takes the entire site down (500 internal server error) There was no .htaccess in the directory I want to protect, but when I crate it and add these including the <IfModule mod_rewrite.c> and RewriteEngine on it seems to have no effect.

          – Elganif
          9 hours ago





          when adding these lines to the .htaccess at site root (with the other rewrite lines) it takes the entire site down (500 internal server error) There was no .htaccess in the directory I want to protect, but when I crate it and add these including the <IfModule mod_rewrite.c> and RewriteEngine on it seems to have no effect.

          – Elganif
          9 hours ago










          Elganif is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Elganif is a new contributor. Be nice, and check out our Code of Conduct.












          Elganif is a new contributor. Be nice, and check out our Code of Conduct.











          Elganif is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267708%2fhow-do-i-block-visitors-from-directly-viewing-images%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Sum ergo cogito? 1 nng

          419 nièngy_Soadمي 19bal1.5o_g

          Queiggey Chernihivv 9NnOo i Zw X QqKk LpB