Mobile app version of vmapp.org
Login or Join
Odierno851

: Did httpd can be rewrite? I'm running on Nginx server. I try to rewrite my URL using .htacces file: RewriteEngine On RewriteBase / RewriteRule ^search/(.+)/page=(.+)$ search-results.php?q=&page=

@Odierno851

Posted in: #Htaccess #Httpd #ModRewrite

I'm running on Nginx server.

I try to rewrite my URL using .htacces file:

RewriteEngine On
RewriteBase /
RewriteRule ^search/(.+)/page=(.+)$ search-results.php?q=&page=


It give me Internal Error 500. Any help?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Odierno851

1 Comments

Sorted by latest first Latest Oldest Best

 

@Radia820

Welcome to WSE. Nginx doesn't support .htaccess and if you trying to use .htaccess with Nginx you are doing it incorrectly.

Apache's .htaccess is powerful and, as I have now learned (thanks @closetnoc ), it caches the .htaccess file until it changes on the disk to avoid reloading it each and everytime. However, you wanted Nginx for it's speed didn't you, so to achieve a similar functionality with Nginx it takes a different approach, one which properly utilises the Nginx config file.

See this link for more details www.nginx.com/resources/wiki/start/topics/examples/likeapache-htaccess/
For further details on how to translate your .htaccess commands to Nginx, google "Converting .htaccess to Nginx"

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme