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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:12:26+00:00 2026-06-05T20:12:26+00:00

With Apache the directive DirectoryIndex index along with DefaultType application/x-httpd-php within a particular vhost

  • 0

With Apache the directive DirectoryIndex index along with DefaultType application/x-httpd-php within a particular vhost worked quite well to exclude a file extension from index files without rewriting. How can I duplicate this in Nginx? So far all I’ve been able to find is regex rewriting solutions.

  • 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-06-05T20:12:28+00:00Added an answer on June 5, 2026 at 8:12 pm

    The .conf file would look 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;
    
        # See if a file or directory was requested first.  If not, try the request as a php file.
        location / {
            try_files $uri $uri/;
        }
    }
    

    the line try_files $uri should try the files without extensions on the backend

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apache lets you set php.ini values for virtual hosts with the php_value directive. Does
Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive?
I am looking for Apache httpd directive, that would immediately return some plaintext content
Using Apache 2.2 and PHP 5, what's the best way to run PHP without
My configuration: Apache 2.2.4 PHP 5.2.4 (fastCGI) Windows XP pro I have a script
I am now exploring to use Apache's mod_proxy's directive, eg ProxyPass, as part of
I am using the Apache Proxy balancer directive to hook up a set of
What affect will enabling the response time (%D) LogFormat directive have on apache performance?
I often see in PHP MVC applications an Apache RewriteRule that looks like this:
This question is about HTTPD (Apache) 2.? on centOS and modperl 1.7+ When I

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.