2016-11-22 1 views
1

.php 확장없이 작동하도록 특정 URL을 구성하려고합니다. 예를 들어 .htaccess를 사용하여 .php없이 작동시키는 특정 URL

는 두 가지 아래 URL에 액세스하려면 :

<IfModule mod_rewrite.c> 
     RewriteEngine On 
     RewriteBase/

     # Removes index.php from ExpressionEngine URLs 
     RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] 
     RewriteCond %{REQUEST_URI} !/library/.* [NC] 
     RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] 

     # Directs all EE web requests through the site index file 
     RewriteCond %{REQUEST_FILENAME} !-f 
     RewriteCond %{REQUEST_FILENAME} !-d 
     RewriteRule ^(.*)$ /index.php?/$1 [L,QSA] 
     # RewriteRule ^(.*)$ /index.php/$1 [L] 
</IfModule> 

답변

2

당신은 당신의 리디렉션 규칙 아래에 재 작성 규칙을 삽입 할 수 있습니다 :

example.com/manage.php 

example.com/manage 

여기에 내 현재의 .htaccess입니다
RewriteEngine On 
RewriteBase/

# Removes index.php from ExpressionEngine URLs 
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] 
RewriteCond %{REQUEST_URI} !/library/.* [NC] 
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] 

# add .php extension to specific URIs 
RewriteRule ^(manage)/?$ $1.php [L,NC] 

# Directs all EE web requests through the site index file 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php?/$1 [L,QSA] 
관련 문제