0

I want to do something like the following:

public class HomeController : Controller
{
    // Redirect to the phpinfo.php file
    public ActionResult PhpInfo()
    {
        return RedirectToRoutePermanent("~/Views/Home/PhpInfo.php");
    }
}

This errors out saying that the route cannot be found.

Any ideas?

Thanks, Zain

7
  • Why would you want to do that? Commented Nov 11, 2013 at 22:58
  • @scartag: I'm trying to add a link to the PhpInfo page for my site. I need a way to execute some php Commented Nov 11, 2013 at 23:01
  • 2
    if you already have php installed and supported in the virtual directory / site you could use the absolute url .. you don't have to use an action sitename/phpInfo.php you'll need to move PhpInfo.php to the root though. Commented Nov 11, 2013 at 23:05
  • 1
    Yes you can simply specify <a href="PhpInfo.php">Php Info</a> if php is supported on the virtual directory / site it should work. Commented Nov 11, 2013 at 23:10
  • 1
    You should install something like FastCGI for IIS to actually support PHP files. Commented Jun 20, 2016 at 19:37

1 Answer 1

1

Answer from scartag in the comments. Stating it below for posterity:

It doesn't seem to be possible using the C# part of ASP.NET, but you can post links by using <a href="/PhpInfo.php">PHP Info</a> syntax

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.