Jump to content

Nginx fURL rewrite help needed


Maxxius

Recommended Posts

Posted

Hi everyone, I tried moving my site of the original server which is Nginx and not apache and immediately I got fURL redirection problems.

I had these set up by former admin when I was on 3.4 and it was working great. But now in 4.0 its not working.

Is it true that these values for rewrite to work must be edited in etc/nginx/sites-available/website.com.vhost file alone. Nowhere else? In my case I use IPSconfig and you can add entries in website options. But I think these values end up in the same files anyway.

What configuration has to be in the file for 4.4 IPS version to function and redirect properly?

So far I tried putting

    location / {
        try_files   $uri $uri/ @ips;
    }

and then 

location / {
	try_files $uri $uri/ /index.php;
}

but none of them seemed to work. 😕

Posted

Had to upgrade the nginx for it to work. Now basic redirects work, yay!

However, now I need this also to work badly on nginx:

http://www.website.com/forums/blogs/* -> http://www.website.com/blogs/*
http://www.website.com/forums/gallery/* -> http://www.website.com/gallery/*
http://www.website.com/forums/files/* ->http://www.website.com/files/*

I actually need the part forums dropped from the URL only when the address is going for forums+blogs/gallery/files. Don't want to loose that google traffic.

I tried using what @newbie LAC provided which works in apache

RewriteRule ^forums/(blogs|gallery|files)/(.*)$ /$1/$2 [L,R=301]

and when I use a online converter apache->nginx I get this and this does not work at all.

location /forums {
  rewrite ^/forums/(blogs|gallery|files)/(.*)$ /$1/$2 redirect;
}

anyone got idea how to rewrite that for nginx? @ASTRAPI @Makoto please 🙂

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...