Different php_value open_basedir based on domain name in .htaccessHow to limit user e-mail sending in shared hosting enviroment - LAMP stackApache outputs all urls of a second domain as a subfolder of the primary domain nameRedirect HTTP requests based on subdomain address without changing accessed URL?htaccess - mask and redirect domain to sub directory on shared hostingHow to customize PHP configuration per Virtual Host under PleskHow do I use .htaccess conditional redirects for multiple domains?Setup secure shared hosting (Apache, PHP, MySQL)LAMP server hosting multiple domains - how to ensure each domain's files and users locked to only that domain?Techniques for securing mod_php for shared hosting (WAMP)?Apache2 give access to specific locations (.htaccess file)

How can I close a gap between my fence and my neighbor's that's on his side of the property line?

Why are notes ordered like they are on a piano?

How to implement float hashing with approximate equality

Airbnb - host wants to reduce rooms, can we get refund?

Can fracking help reduce CO2?

When and why did journal article titles become descriptive, rather than creatively allusive?

Why is the SNP putting so much emphasis on currency plans?

How to efficiently calculate prefix sum of frequencies of characters in a string?

Field Length Validation for Desktop Application which has maximum 1000 characters

Map one pandas column using two dictionaries

Is Cola "probably the best-known" Latin word in the world? If not, which might it be?

Selecting a secure PIN for building access

Was the ancestor of SCSI, the SASI protocol, nothing more than a draft?

What happened to Ghost?

Binary Numbers Magic Trick

Why debootstrap can only run as root?

Why was Germany not as successful as other Europeans in establishing overseas colonies?

What is the most remote airport from the center of the city it supposedly serves?

If Melisandre foresaw another character closing blue eyes, why did she follow Stannis?

Is this homebrew race based on the Draco Volans lizard species balanced?

How to reply this mail from potential PhD professor?

How do I tell my manager that his code review comment is wrong?

Can commander tax be proliferated?

Power LED from 3.3V Power Pin without Resistor



Different php_value open_basedir based on domain name in .htaccess


How to limit user e-mail sending in shared hosting enviroment - LAMP stackApache outputs all urls of a second domain as a subfolder of the primary domain nameRedirect HTTP requests based on subdomain address without changing accessed URL?htaccess - mask and redirect domain to sub directory on shared hostingHow to customize PHP configuration per Virtual Host under PleskHow do I use .htaccess conditional redirects for multiple domains?Setup secure shared hosting (Apache, PHP, MySQL)LAMP server hosting multiple domains - how to ensure each domain's files and users locked to only that domain?Techniques for securing mod_php for shared hosting (WAMP)?Apache2 give access to specific locations (.htaccess file)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I want to limit access to files using PHP open_basedir for multiple domains. Every domain sits in own directory, so I want prevent all domains PHP scripts from interfering with each other. How can I set different open_basedir path for every domain in single .htaccess?



If it would be only 1 domain, it could look like this:



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/example.com/


Every user has FTP account limited to /hosting/domains/example.com/.
So, obviously, I can not put .htaccess into /hosting/domains/example.com/.htaccess as user would be able to change .htaccess content. So, there must be single .htaccess in /hosting/domains/.htaccess for all domains.



This is how I imagine it, is something like this possible?



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/$current_domain/


I am using: Apache 2.4, PHP 5.5










share|improve this question






















  • May be just add it to virtual host configuration? Why it should be in .htaccess?

    – Somescout
    Nov 15 '14 at 11:57












  • I am on shared hosting without access to httpd.conf. Can use .htaccess only.

    – Martin
    Nov 15 '14 at 15:18


















1















I want to limit access to files using PHP open_basedir for multiple domains. Every domain sits in own directory, so I want prevent all domains PHP scripts from interfering with each other. How can I set different open_basedir path for every domain in single .htaccess?



If it would be only 1 domain, it could look like this:



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/example.com/


Every user has FTP account limited to /hosting/domains/example.com/.
So, obviously, I can not put .htaccess into /hosting/domains/example.com/.htaccess as user would be able to change .htaccess content. So, there must be single .htaccess in /hosting/domains/.htaccess for all domains.



This is how I imagine it, is something like this possible?



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/$current_domain/


I am using: Apache 2.4, PHP 5.5










share|improve this question






















  • May be just add it to virtual host configuration? Why it should be in .htaccess?

    – Somescout
    Nov 15 '14 at 11:57












  • I am on shared hosting without access to httpd.conf. Can use .htaccess only.

    – Martin
    Nov 15 '14 at 15:18














1












1








1








I want to limit access to files using PHP open_basedir for multiple domains. Every domain sits in own directory, so I want prevent all domains PHP scripts from interfering with each other. How can I set different open_basedir path for every domain in single .htaccess?



If it would be only 1 domain, it could look like this:



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/example.com/


Every user has FTP account limited to /hosting/domains/example.com/.
So, obviously, I can not put .htaccess into /hosting/domains/example.com/.htaccess as user would be able to change .htaccess content. So, there must be single .htaccess in /hosting/domains/.htaccess for all domains.



This is how I imagine it, is something like this possible?



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/$current_domain/


I am using: Apache 2.4, PHP 5.5










share|improve this question














I want to limit access to files using PHP open_basedir for multiple domains. Every domain sits in own directory, so I want prevent all domains PHP scripts from interfering with each other. How can I set different open_basedir path for every domain in single .htaccess?



If it would be only 1 domain, it could look like this:



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/example.com/


Every user has FTP account limited to /hosting/domains/example.com/.
So, obviously, I can not put .htaccess into /hosting/domains/example.com/.htaccess as user would be able to change .htaccess content. So, there must be single .htaccess in /hosting/domains/.htaccess for all domains.



This is how I imagine it, is something like this possible?



# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/$current_domain/


I am using: Apache 2.4, PHP 5.5







php .htaccess open-basedir






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '14 at 11:25









MartinMartin

1065




1065












  • May be just add it to virtual host configuration? Why it should be in .htaccess?

    – Somescout
    Nov 15 '14 at 11:57












  • I am on shared hosting without access to httpd.conf. Can use .htaccess only.

    – Martin
    Nov 15 '14 at 15:18


















  • May be just add it to virtual host configuration? Why it should be in .htaccess?

    – Somescout
    Nov 15 '14 at 11:57












  • I am on shared hosting without access to httpd.conf. Can use .htaccess only.

    – Martin
    Nov 15 '14 at 15:18

















May be just add it to virtual host configuration? Why it should be in .htaccess?

– Somescout
Nov 15 '14 at 11:57






May be just add it to virtual host configuration? Why it should be in .htaccess?

– Somescout
Nov 15 '14 at 11:57














I am on shared hosting without access to httpd.conf. Can use .htaccess only.

– Martin
Nov 15 '14 at 15:18






I am on shared hosting without access to httpd.conf. Can use .htaccess only.

– Martin
Nov 15 '14 at 15:18











2 Answers
2






active

oldest

votes


















0














I think it is not possible. Every domain has to have specific .htaccess file because this file is settings per folder so there is no way to specify subfolder. And even this is possible then user can use his own .htaccess file to override settings.



On shared hosting is only one solution. One user account per domain.






share|improve this answer






























    0














    You can set open_basedir into virtualhost, so users won't be able to edit or delete it, within <Directory> directive.






    share|improve this answer

























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "2"
      ;
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f644569%2fdifferent-php-value-open-basedir-based-on-domain-name-in-htaccess%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      I think it is not possible. Every domain has to have specific .htaccess file because this file is settings per folder so there is no way to specify subfolder. And even this is possible then user can use his own .htaccess file to override settings.



      On shared hosting is only one solution. One user account per domain.






      share|improve this answer



























        0














        I think it is not possible. Every domain has to have specific .htaccess file because this file is settings per folder so there is no way to specify subfolder. And even this is possible then user can use his own .htaccess file to override settings.



        On shared hosting is only one solution. One user account per domain.






        share|improve this answer

























          0












          0








          0







          I think it is not possible. Every domain has to have specific .htaccess file because this file is settings per folder so there is no way to specify subfolder. And even this is possible then user can use his own .htaccess file to override settings.



          On shared hosting is only one solution. One user account per domain.






          share|improve this answer













          I think it is not possible. Every domain has to have specific .htaccess file because this file is settings per folder so there is no way to specify subfolder. And even this is possible then user can use his own .htaccess file to override settings.



          On shared hosting is only one solution. One user account per domain.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 16 '14 at 19:10









          TomášTomáš

          1042




          1042























              0














              You can set open_basedir into virtualhost, so users won't be able to edit or delete it, within <Directory> directive.






              share|improve this answer





























                0














                You can set open_basedir into virtualhost, so users won't be able to edit or delete it, within <Directory> directive.






                share|improve this answer



























                  0












                  0








                  0







                  You can set open_basedir into virtualhost, so users won't be able to edit or delete it, within <Directory> directive.






                  share|improve this answer















                  You can set open_basedir into virtualhost, so users won't be able to edit or delete it, within <Directory> directive.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 26 '17 at 2:54

























                  answered Apr 26 '17 at 2:49









                  mapolonemapolone

                  14




                  14



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Server Fault!


                      • 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%2fserverfault.com%2fquestions%2f644569%2fdifferent-php-value-open-basedir-based-on-domain-name-in-htaccess%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

                      Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                      Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                      What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company