• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

IIS web.config forwarding not working right?

R.I.P Millercent
Loyal Member
Joined
Nov 6, 2012
Messages
2,230
Reaction score
314
Hi,

Another day, another problem. I'm using IIS 7 with a CMS. Basically, my error is like this. A user on the site should be able to go to for example localhost/home/(username) and it displays set usernames information. How ever, for some reason my IIS is reading it as localhost/info/username and that username is a specific .php file like this;

NvK4GRt - IIS web.config forwarding not working right? - RaGEZONE Forums

Here is my URL Re-write for it,
PHP:
<rule name="Imported Rule 209">
                    <match url="^home(|/)$" ignoreCase="false" />
                    <action type="Rewrite" url="home.php" />
                </rule>
                <rule name="Imported Rule 210">
                    <match url="^home/(..*)$" ignoreCase="false" />
                    <action type="Rewrite" url="./home.php?web-home-name={R:1}" appendQueryString="false" />
                </rule>

So it basically generates all the information from /home.php for the username you input into your browser, how ever for some reason it's not just doing that. It also does it if I simply go to say localhost/community/staff - In my web.config it's stated to load /staff.php for that URL, how ever it tries to load community/staff.php for some reason.

UPDATE

I think it has something to do with apply x/x/x and for instance not /index.php?p=xx for example. Not so sure.

Anyone any ideas?

My full web.config is here -

Cheers.
 

Attachments

You must be registered for see attachments list
Last edited:
Pessimistic butt@%&!
Loyal Member
Joined
Jan 18, 2008
Messages
2,057
Reaction score
487
Wouldn't this be more suited for Coder's Paradise?
 
Experienced Elementalist
Joined
Jul 1, 2012
Messages
232
Reaction score
37
Your input is home/Michael.php
yet your IIS says home/XXX, not .php included
 
Experienced Elementalist
Joined
Jul 1, 2012
Messages
232
Reaction score
37
That's true becuase that's how it's meant to work. It's meant load home.php and generate data for what ever username you put in the URL. Not attempt to load url/home/username.php

So you're saying the user has to request URL URL/home/NAME.php
If so, change your web.config to something like
Code:
				<rule name="homes">
					<match url="^home/([^/]+).php" ignoreCase="false" />
					<action type="Rewrite" url="/home.php?urser={R:1}" appendQueryString="false" />
				</rule>
 
Back
Top