Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5848311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:50:28+00:00 2026-05-22T12:50:28+00:00

When developing PHP applications it’s common to have a public folder somewhere in the

  • 0

When developing PHP applications it’s common to have a public folder somewhere in the application structure at which the webserver is targeted. The private application code is stored outside this directory so it is not publicly accessible.

I’ve a PHP application I’m trying to run on Azure and want to configure a directory within my WebRole to be the ‘public directory’, but in Eclipse (I’m using the PHP Azure plugin) I don’t see any options to configure it. Is there any way to configure the actual ‘root’ directory of the role? Or is the role inherently public, and therefore I should be storing my private code somewhere else and sharing it with the WebRole?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:50:29+00:00Added an answer on May 22, 2026 at 12:50 pm

    By default, the root of the website is always public on the IIS configuration in Windows Azure. However, since URL rewriting is supported, it’s pretty easy to overcome this.

    Just as with .htaccess and mod_rewrite on Apache, you can rewrite the current request to a different folder. IIS will use this information internally to find your files, but the user’s browser will never notice this rewrite happens.

    Here’s a portion of XML that you can copy/paste in your Web.config file. The public root in the below code is “public”, if this is “shizzle” make sure to change that 🙂

    <!-- Rewrite rules to /public -->
    <rewrite>
      <rules>
        <clear />
        <rule name="TransferToPublic" patternSyntax="Wildcard" stopProcessing="true">
          <match url="*" />
          <action type="Rewrite" url="public/{R:0}" />
        </rule>
      </rules>
    </rewrite>
    

    For reference: this is to be located under the XML node.

    Another option is “building your own role”, like I partially did in this post Lightweight PHP application deployment to Windows Azure. By tweaking some of the files, you can trick IIS into a different public root. If you use my blog post for the packaging part for Azure and use Google/Bing/MSDN for the IIS configuration part, this should also work.

    Enjoy!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am just starting out developing PHP web applications and have finished setting
I have quite a few years experience of developing PHP web applications, and have
i am developing a php application which run on offline mode mean not connect
I am developing a PHP application which will handling many company articles. Now I
I'm developing a PHP application which uses Twig (but that's unimportant) as the view
I am developing a PHP application which needs a regular expression to replace the
I am developing a PHP/MySQL application which entails processing of CSV files but the
I'm currently developing a PHP application that's using an Access database as a backend.
I am developing a PHP/MySQL application using vertrigoserver. I need to enter the German
I'm using NetBeans 6.5 for developing PHP and I have xdebug setup. Is there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.