简体   繁体   中英

Redirect Nginx Permalink?

My website got de-index by search engine and I want to redirect to another domain with different permalink search. Can you help me to redirect from:

http://www.old-domain.com/gallery-some-title-keyword/

to

http://www.new-domain.com/s/some-title-keyword.html

Anyone help me? My website is use nginx webserver.

Update notes:

1) Where /s/ on permalink is first char from some . So, if old permalink is /gallery-true-title/ should be redirect to /t/true-title.html

I would try the following location in your old-domain.com server stanza:

location ~ ^/gallery-(.)([^/]+)/ {
    return 301 http://www.new-domain.com/$1/$1$2.html;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM