2013-08-28 2 views
-2

현재 가입 페이지에서 작업 중이며 .php 확장자없이 URL을 수정할 수 있는지 궁금합니다.페이지 확장없이 페이지를 리디렉션하는 방법

예를 들어

, 지금

www.xyz.com/signup.php 

입니다 그리고 내가 무엇을 달성하고자하는 것은 내가 htaccess로 파일을 사용 할 수 있음을 가정하고 이제

www.xyz.com/signup 

이지만, 나는 확실하지 않다 그것에 대해.

+0

가능한 중복 [htaccess로와 .PHP 확장자를 제거 (http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – Bora

답변

1

첫 번째 규칙 signup.php에서 domain.com/signup/로 리디렉션됩니다 htaccess로로 복제 할 수 있습니다.

두 번째 규칙은 의 콘텐츠를 표시하는 동안 URL은 domain.com/signup/으로 유지되므로 내부적으로 리디렉션됩니다. 의

Options +FollowSymLinks -MultiViews 

RewriteEngine On 
RewriteBase/

# Redirect /signup.php to /signup/ 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+signup\.php\s [NC] 
RewriteRule^/signup/? [R=302,L] 

# Internally forward /signup/ to /signup.php 
RewriteRule ^signup/?$ /signup.php [NC,L] 
+0

감사합니다. Prix .. 도움을 청합니다. – rahulrajj

0

당신은

RewriteEngine On 

RewriteRule singup$ singup.php [NC,L] 
관련 문제