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 4577342
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:19:58+00:00 2026-05-21T20:19:58+00:00

Hey, I have a PHP Windows Azure project but I am new to IIS.

  • 0

Hey, I have a PHP Windows Azure project but I am new to IIS. I have my PHP libs in root folder and client files like index.php, style sheets or javascripts in a subfolder called document_root.

How can I set up IIS 7 (probably using Web.config) to use the document_root as the default folder for the site (making the root invisible) so i can call mydomain.tld/ instead of mydomain.tld/document_root/

I have used:

<defaultDocument>
  <files>
    <clear />
    <add value="document_root/index.php" />
  </files>
</defaultDocument>

Which works fine but it accesses only the index.php and cant find any files like /document_root/css/default.css (the relative address is css/default.css)

  • 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-21T20:19:59+00:00Added an answer on May 21, 2026 at 8:19 pm

    There are 2 ways to do this. The easy route is to use the URL Rewriting module included in IIS7. An example to redirect requests to the Public folder (and disallow direct access to that folder) :

    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="blockAccessToPublic" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{URL}" pattern="/public/*" />
                    </conditions>
                    <action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
                </rule>
                <rule name="RewriteRequestsToPublic" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    </conditions>
                    <action type="Rewrite" url="public/{R:0}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
    

    The other way is to change the IIS settings once your PHP application is deployed. To do that you need to override the OnStart method of your web role, but I think the first solution will suit your needs.

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

Sidebar

Related Questions

Hey I am very new to PHP, I come from a design background, but
Hey, I'm quite experienced with PHP but I have no idea what the keyword
Hey everyone... I'm not too familiar with PHP... but I have PHP code that
Hey I am very new to Web Programming. I have been learning PHP from
Hey, I need help isolating part of a url in PHP. say I have
Hey I have downloaded one of the xml editors from some site. But don't
Hey I have this code but it doesn't work because it is expecting a
Hey guys I have one php exec command that works on my remote linux
hey guys how to make these php html links codes possible. i have tried
Hey guys I have an ajax jquery function that receives data from a php

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.