Score:0

How do I Convert nginx to Apache rewrites?

pw flag

My local machine is Apache2.4 and this is the redirect scheme on nginx. How do I write this using RewriteRules?

location / {
 if (!-e $request_filename) {
   rewrite ^/(.[a-zA-Z0-9\-\_]+).html$ /index.php?mod=$1 last;
 }
 rewrite ^/pay/(.*)$ /pay.php?s=$1 last;
}
location ^~ /plugins {
  deny all;
}
location ^~ /includes {
  deny all;
}
sv flag
Welcome to ServerFault! What have you tried so far?
djdomi avatar
za flag
`RewriteEngine On RewriteBase / location / { if (!-e $request_filename) { rewrite ^/(.[a-zA-Z0-9\-\_]+).html$ /index.php?mod=$1 last; } RewriteRule ^pay/(.*)$ pay.php?s=$1 } location ^~ /plugins { deny all; } location ^~ /includes { deny all; }` #try this first
Xiaoliang Chang avatar
pw flag
I tried this: RewriteEngine On RewriteRule ^(.[a-zA-Z0-9\-\_]+).html$ index.php?mod=$1 RewriteRule ^pay/(.*)$ pay.php?s=$1
Romain avatar
cn flag
Does this answer your question? [How do I Convert nginx to Apache rewrites](https://serverfault.com/questions/994755/how-do-i-convert-nginx-to-apache-rewrites)
Michael Hampton avatar
cz flag
You don't still have the original Apache rewrite rules that these were converted from?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.