2013-05-23 4 views
2

현재 설치 프로그램은 Magento 1.7.0.2가있는 Ubuntu 12.04 LTS, Nginx 1.4.1을 실행합니다.Nginx를 사용하는 동안 Magento URL에서 index.php 제거

오늘 이전에 저는 Magento의 기본 상점을 설립했습니다. 모듈을 설치하지 않았으며 구성을 변경하지 않았습니다. 시스템을 더 깊이 파고 들기 전에 기초 작업을하기 위해 찾고 있습니다. 도메인 이름과 파일 경로 사이에 나타나는 "index.php"를 제거하려고합니다.

내 가상 호스트가 nginx를 웹 사이트에서 가져온 것입니다

server { 
    root  /path/to/root/domain/html; 
    index index.php; 
    error_log /path/to/error/log/error.log; 
    access_log /path/to/transfer/log/transfer.log; 
    server_name servername.com; 
    location/{ 
    index index.html index.php; 
    try_files $uri $uri/ @handler; 
    expires 30d; 
    } 

    location ^~ /(app|includes|lib|media/downloadable|pkginfo|report/config.xml|var)/ {  internal; } 
    location /var/export/ { internal; } 
    location /. { return 404; } 
    location @handler { rewrite//index.php; } 
    location ~* .php/ { rewrite ^(.*.php)/ $1 last; } 
    location ~* .php$ { 
    if (!-e $request_filename) { rewrite//index.php last; } 
    expires off; 
    fastcgi_pass 127.0.0.1:9000; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    fastcgi_param MAGE_RUN_CODE default; 
    fastcgi_param MAGE_RUN_TYPE store; 
    include fastcgi_params; 
    } 
} 

나는 다른 사람들이이 질문에 대한 답변을 검색 한 것을보고,이 솔루션 코드 조각이 있지만,이 중 어느 것도 작동 표시되지 않습니다 내 시스템과. 내 Nginx 가상 호스트를 변경하면 항상 nginx를 다시 시작하지만 index.php는 여전히 URL에 표시됩니다.

답변

0

Nginx 설정이 정상적으로 보입니다. 관리자 패널의 system > configuration > general > webUse Web Server Rewrites에서 yes으로 설정하고 캐시를 지우십시오.

+0

4040에 대한 대시 보드에 액세스 할 수없는 경우 어떻게 쉘 또는 데이터베이스에서이 값을 수정할 수 있습니까? – abkrim

0

magento nginx 가상 호스트에 추가하십시오.

location/{ 
      if (!-e $request_filename) { 
        rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last; 
      } 
      if ($uri ~* "\.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$") { 
        expires max; 
        break; 
      } 
    } 
관련 문제