Welcome! Log In Create A New Profile

Advanced

Help with htaccess conversion. After conversion it's downloading a php file instead of redirecting

Posted by titooo 
Hi,

I just migrated one of my websites from apache and I'm having some problems with htaccess conversion.
Here is the htacces I had on apache that worked perfectly:

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^feed.xml %{HTTP_SERVER}/feed.php [L]
RewriteRule ^sitemap.xml %{HTTP_SERVER}/sitemap.php [L]
RewriteRule ^tag/(.*) %{HTTP_SERVER}/tags.php?t=$1 [L]
RewriteRule ^type/(.*) %{HTTP_SERVER}/category.php?c=$1 [L]
RewriteRule ^about/(.*) %{HTTP_SERVER}/infos.php?s=$1 [L]

And that's what I got after doign the conversion with http://winginx.com/htaccess and adding it to /etc/nginx/sites-available/mydomain.com:

# nginx configuration

location /feed {
rewrite ^/feed.xml /$http_server/feed.php break;
}

location /sitemap {
rewrite ^/sitemap.xml /$http_server/sitemap.php break;
}

location /tag {
rewrite ^/tag/(.*) /$http_server/tags.php?t=$1 break;
}

location /type {
rewrite ^/type/(.*) /$http_server/category.php?c=$1 break;
}

location /about {
rewrite ^/about/(.*) /$http_server/infos.php?s=$1 break;
}


After that I restarted nginx and php-fpm services but once I try to acces to one of those urls it downloads a file instead of doing the redirection. Could anyone help me to solve this?

Thanks in advance,
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 218
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready