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

  • Home
  • SEARCH
  • 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 7507595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:31:07+00:00 2026-05-29T22:31:07+00:00

I have an .htaccess file that I’m trying to convert so it can be

  • 0

I have an .htaccess file that I’m trying to convert so it can be run on my Nginx server.

I’m having two primary problems:

1. I’m not sure how to convert some lines

2. I don’t know where to put the Nginx configuration code

Here are the lines I’m having issues converting:

 Options All -Indexes

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

 RewriteRule ^(.*)$ index.php?page_request=$1 [QSA,L]

I’ve tried some online converters, but they don’t seem to be working.

Also, once I’ve converted the lines, where do I put them? I assume I need to place them in the mysite.conf file in /etc/nginx/sites-available/, but within that file, do I just put them within the server {} block?

Thanks a lot for any help you can give me.

Edit: Here’s the conf file

 server {
    listen 0.0.0.0:80;
    server_name www.subdomain.domain.tld subdomain.domain.tld;
    access_log /var/log/subdomain.domain.tld.log;

    location / {
        root /srv/www/subdomain.domain.tld/public_html;
        index index.html index.php;
        }
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME /srv/www/subdomain.domain.tld/public_html$fastcgi_script_name;
        }

       try_files $uri $uri/ /index.php?page_request=$uri;
}
  • 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-29T22:31:08+00:00Added an answer on May 29, 2026 at 10:31 pm

    UPDATE

    Doing some nginx research, came across this, give this a shot and see if it works as you expect:

    location / {
        # other code below this line
        try_files $uri $uri/ /index.php?page_request=$uri;
    }
    

    Basically the try_files is the if statement, it tries the regular file first, if it cannot find it, it tries it as a directory, if it cannot find that it sends it to the last argument.


    OLD

    Have you tried using a service like: http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

    It outputs:

    #ignored: condition 0
    #ignored: condition 1
    if ($rule_0 = "2"){
    rewrite /RewriteRule ^/(.*)$;
    }
    

    For the data you provided.

    Where you put them is inside the:

    server {
    
    }
    

    Since this is not for a specific location you would just put it after the default stuff. There is order of operations to be had, so yea. It can be inside of a location, if you have more than one location type bit. For nginx, I would probably put this under the .php location definition.

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

Sidebar

Related Questions

I would like to have one .htaccess file that can rewrite correctly on both
I have a working .htaccess file that changes .php to .html. How can I
Ok, so I have this .htaccess file that contains this <IfModule mod_rewrite.c> RewriteEngine On
I have created an .htaccess files that will prevent anyone from accessing a file
I have a link which looks like that: www.domain.com/file.php I want to create .htaccess
Say I have a htaccess file shared by dev.server and server.site.com. The first domain
I have an .htaccess file that authenticates users against LDAP using mod_auth_ldap . My
I have an .htaccess file that is not working properly. And it used to.
I have the following code for my .htaccess file that I've picked up from
I have a rewriterule in my htaccess file that looks like this: RewriteRule ^Signup$

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.