IIS web.config forwarding not working right?

Results 1 to 6 of 6
  1. #1
    R.I.P Millercent FatalLulz is offline
    MemberRank
    Nov 2012 Join Date
    AustraliaLocation
    2,248Posts

    IIS web.config forwarding not working right?

    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;



    Here is my URL Re-write for it,
    PHP Code:
    <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 - http://pastie.org/9795273

    Cheers.
    Last edited by FatalLulz; 23-12-14 at 04:23 AM.


  2. #2
    Pessimistic Ass@%&! Monolith is offline
    MemberRank
    Jan 2008 Join Date
    DallasLocation
    2,301Posts

    Re: IIS web.config forwarding not working right?

    Wouldn't this be more suited for Coder's Paradise?

  3. #3
    Omega ChewBecca is offline
    MemberRank
    Oct 2005 Join Date
    Low Wycombe, CLocation
    7,579Posts

    Re: IIS web.config forwarding not working right?

    Moved to coders!

  4. #4
    Account Upgraded | Title Enabled! AskethZ is offline
    MemberRank
    Jul 2012 Join Date
    232Posts

    Re: IIS web.config forwarding not working right?

    Your input is home/Michael.php
    yet your IIS says home/XXX, not .php included

  5. #5
    R.I.P Millercent FatalLulz is offline
    MemberRank
    Nov 2012 Join Date
    AustraliaLocation
    2,248Posts

    Re: IIS web.config forwarding not working right?

    Quote Originally Posted by AskethZ View Post
    Your input is home/Michael.php
    yet your IIS says home/XXX, not .php included
    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

  6. #6
    Account Upgraded | Title Enabled! AskethZ is offline
    MemberRank
    Jul 2012 Join Date
    232Posts

    Re: IIS web.config forwarding not working right?

    Quote Originally Posted by FatalLulz View Post
    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>



Advertisement