2011-09-05 4 views
1

아래는 .htaccess 파일입니다. 이 파일이 제대로 작동하는지 확인해야하지만 테스트하는 방법을 알지 못합니다. 어떠한 제안?.htaccess (url rewrite)가 제대로 작동하는지 확인하는 방법

Options +FollowSymlinks 
RewriteEngine On 
RewriteBase /crown/ 

AddType text/xml .xslt 
DirectoryIndex index.php 

<Files *.xslt> 
    SetHandler text/xml 
</Files> 

<IfModule !mod_php4.c> 

    <IfModule !mod_php5.c> 

     # PHP is in CGI Mode, so we need a different mod_rewrite 

     RewriteCond %{REQUEST_URI} !categories\.php 
     RewriteRule ^categories(.*) categories.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !articles\.php 
     RewriteRule ^articles(.*)$ articles.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !pages\.php 
     RewriteRule ^pages(.*)$ pages.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !blogs\.php 
     RewriteRule ^blogs(.*)$ blogs.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !search.php 
     RewriteRule ^search(.*)$ search\.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !authors.php 
     RewriteRule ^authors(.*)$ authors\.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !articlerss.php 
     RewriteRule ^articlerss(.*)$ articlerss\.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !news.php 
     RewriteCond %{REQUEST_URI} !newsrss.php 
     RewriteRule ^news(.*)$ news.php?$1 [L] 

     RewriteCond %{REQUEST_URI} !contact.php 
     RewriteRule ^contact(.*)$ contact\.php?$1 [L] 


    </IfModule> 

    <IfModule mod_php5.c> 

     # Using PHP 5 in module mode 

     RewriteCond %{REQUEST_URI} categories.* 
     RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} articles.* 
     RewriteRule ^articles(.*)$ articles.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} pages.* 
     RewriteRule ^pages(.*)$ pages.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} blogs.* 
     RewriteRule ^blogs(.*)$ blogs.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} search.* 
     RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} authors.* 
     RewriteRule ^authors(.*)$ authors.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} articlerss.* 
     RewriteRule ^articlerss(.*)$ articlerss.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} news.* 
     RewriteCond %{REQUEST_URI} !newsrss 
     RewriteRule ^news(.*)$ news.php?$1 [T=application/x-httpd-php,L] 

     RewriteCond %{REQUEST_URI} contact.* 
     RewriteRule ^contact(.*)$ contact.php?$1 [T=application/x-httpd-php,L] 

    </IfModule> 

</IfModule> 

<IfModule mod_php4.c> 

    # PHP 4 in module mode 

    RewriteCond %{REQUEST_URI} categories.* 
    RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} articles.* 
    RewriteRule ^articles(.*)$ articles.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} pages.* 
    RewriteRule ^pages(.*)$ pages.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} blogs.* 
    RewriteRule ^blogs(.*)$ blogs.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} search.* 
    RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} authors.* 
    RewriteRule ^authors(.*)$ authors.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} articlerss.* 
    RewriteRule ^articlerss(.*)$ articlerss.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} news.* 
    RewriteCond %{REQUEST_URI} !newsrss 
    RewriteRule ^news(.*)$ news.php?$1 [T=application/x-httpd-php,L] 

    RewriteCond %{REQUEST_URI} contact.* 
    RewriteRule ^contact(.*)$ contact.php?$1 [T=application/x-httpd-php,L] 

</IfModule> 

답변

1

이 질문은 earlier message과 관련 있습니다. 결국, 문제는 서버에 있었고, 관리자는 설정에서 뭔가를 바꾼 아파치 서버를 업그레이드했습니다. 다음 줄을 추가하면 URL 다시 쓰기가 다시 작동합니다.

Options -MultiViews 
관련 문제