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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:22:27+00:00 2026-05-26T04:22:27+00:00

What rule would I use for nginx so my default file extension is .php?

  • 0

What rule would I use for nginx so my default file extension is .php?

I currently access a pages using http://www.mywebsite.com/home.php but I want to just use http://www.mywebsite.com/home

Thanks

  • 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-26T04:22:27+00:00Added an answer on May 26, 2026 at 4:22 am

    Assuming you also want to serve static files, you could use something like this:

    server {
      server_name example.com;
    
      # Set the docroot directly in the server
      root /var/www;
    
      # Allow index.php or index.html as directory index files
      index index.html index.php;
    
      # See if a file or directory was requested first.  If not, try the request as a php file.
      location / {
        try_files $uri $uri/ $uri.php?$args;
      }
    
      location ~ \.php$ {
        # If the php file doesn't exist, don't pass the request to php, just return a 404
        try_files $uri =404;
    
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
    
        fastcgi_pass your_php_backend_address;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would I write a redirect rule that would let me use both http://www.site.com/rss
Which redirect rule would I use to redirect all pages under olddomain.example to be
What's the easiest way to convert these requests: http://www.example.com/en/ http://www.example.com/en/index.php To: http://www.example.com/index.php?language_id=en There's various
What kind of jquery validation rule would you use to specify that if a
I would like to write a xslt rule if it matches a certain chapter
I would like to work out a number's factorial. My factorial rule is in
As a general rule, I prefer using value rather than pointer semantics in C++
I have this rewrite rule RewriteEngine On RewriteBase /location/ RewriteRule ^(.+)/?$ index.php?franchise=$1 Which is
How would I use numpy to calculate the intersection between two line segments? In
I would like to use a single Makefile to generate targets in hundreds of

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.