Reputation: 21
I have a php site hosted in Azure server(IIS server),I want to set up a test environment for the site like this http://example.com/test1/, but the problem is existing rewrite rule treat 'test1' as parameter(Controller name)rather than a folder name,
<rewrite>
<rules>
<rule name="Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
this is the rewrite rule from web.config file that I am currently using. example.com/index/login works fine but example.com/test1/index/login returns an error 'application/default/controller/test1.php' in the page,the code is still executing from root folder. Please let me know how to fix this issue.
Upvotes: 1
Views: 517
Reputation: 3293
If you want to set a test environment, I would suggest you set up a staging environment for your web app, refer to https://azure.microsoft.com/en-gb/documentation/articles/web-sites-staged-publishing/ for more details. If you want to set virtual directory for you web app for some purpose, please consider configuring in your azure portal, it is very easy to do this, you can configure as the following screenshot:
and then deploy your application in this "test" folder. Hope this helps.
Upvotes: 1