Closed (fixed)
Project:
Octopus
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2011 at 14:33 UTC
Updated:
18 Aug 2011 at 11:21 UTC
I moved old website to subdomain and installed Drupal 7 on main domain and would like to rewrite urls to the subdomain.
Old urls where in format index.php?main=something..... And I want to achieve that when somebody uses those old urls, it will redirect him to:
http://old.domain.com/index.php?main=something....
I tried to add this rewrite line:
rewrite ^/(index\.php\?main=.*)$ http://old.domain.com/$1 last;
into /data/disk/o1/config/server_master/nginx/vhost.d/domain.com file, restarted nginx service restart nginx, but it doesn't do anything and users still stay on main domain.
Where should I put rewrite rule, or what should I do to achieve redirection?
Comments
Comment #1
omega8cc commentedTry to add this rewrite in the nginx_vhost_include.conf file, as explained in: http://drupalcode.org/project/octopus.git/blob/HEAD:/docs/HINTS.txt
rewrite ^/(index\.php\?main=)(.*)$ http://old.domain.com/$1$2 permanent;Comment #2
anantagati commentedI created file nginx_vhost_include.conf in /data/disk/o1/config/server_master/nginx/post.d directory and pasted rewrite text. Also tried
service nginx restart, but it still doesn't redirect.Comment #3
omega8cc commentedComment #4
anantagati commentedSeems like query string has to be handled separately.
This is working:
Comment #5
omega8cc commentedOr when you want to send the request with URI+args: