2012-10-18 3 views
1

우리는 이전 버전의 Magento (1.4)가 nginx 서버에서 실행되고 있습니다. 사이트에 영구적 인 301 리디렉션으로 변환해야하는 임시 리디렉션 (302)이 몇 개 있습니다. 관리자 패널을 통해 1.4에서이 작업을 수행 할 수있는 방법이 없습니다. (Magento 1.4 - nginx 서버 | 302는 영구 301에요?

?의 nginx 구성 지침은 여기

내 구성 도메인에 대한 파일이 작업을 수행하는 각, 당신은 location / 블록의 내부에, 당신의 nginx 구성에 다음 행을 추가 할 수 있습니다 리디렉션에 대한

rewrite ^/minify/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last; 
    rewrite ^/skin/m/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last; 

    location/{ 
     # First attempt to serve request as file, then 
     # as directory, then fall back to index.html 

     try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler 
     expires 30d; ## Assume all files are cachable 
    } 

    location /app/    { deny all; } 
    location /includes/   { deny all; } 
    location /lib/    { deny all; } 
    location /media/downloadable/ { deny all; } 
    location /pkginfo/   { deny all; } 
    location /report/config.xml { deny all; } 
    location /var/    { deny all; } 

    location /lib/minify/ { 
     allow all; 
    } 

    location /var/export/ { ## Allow admins only to view export folder 
     auth_basic   "Restricted"; ## Message shown in login window 
     auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword 
     autoindex   on; 
    } 

    location /. { ## Disable .htaccess and other hidden files 
     return 404; 
    } 

    location @handler { ## Magento uses a common front handler 
     rewrite//index.php; 
    } 

    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler 
     rewrite ^(.*.php)/ $1 last; 
    } 

    location ~* ^(.+\.php)(.*) { 

     if (!-e $request_filename) { rewrite ^(.*)$ /index.php break; } 
     ## Catch 404s that try_files miss 

      fastcgi_pass 127.0.0.1:9000; 
      fastcgi_index index.php; 
      fastcgi_param HTTPS $fastcgi_https; 
      #fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores 
      #fastcgi_param MAGE_RUN_TYPE store;                    
      fastcgi_param SCRIPT_FILENAME /usr/share/nginx/luxuryleathergoods.com/public_html$fastcgi_script_name; 
      fastcgi_split_path_info  ^(.+\.php)(.*)$; 
      include  fastcgi_params; 
     } 

    } 

답변

0

(첫번째) :

rewrite /old/url.html /new/url.html