2015-02-02 3 views
3

Wamp Server 및 URL 다시 쓰기에 문제가 있습니다. 프로덕션 서버에서 내 프로젝트를 .htaccess으로 가져 왔습니다. URL 재 작성은 프로덕션에서는 정상적으로 작동하지만 localhost에서는 정상적으로 작동하지 않습니다.URL Wamp 서버에서 다시 쓰기가 작동하지 않습니다.

내 Wamp 구성에서 rewrite_module이 활성화되었습니다. httpd.conf 파일에서 :

<Directory "c:/wamp/www/"> 
# 
# Possible values for the Options directive are "None", "All", 
# or any combination of: 
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
# 
# Note that "MultiViews" must be named *explicitly* --- "Options All" 
# doesn't give it to you. 
# 
# The Options directive is both complicated and important. Please see 
# http://httpd.apache.org/docs/2.4/mod/core.html#options 
# for more information. 
# 
Options Indexes FollowSymLinks 

# 
# AllowOverride controls what directives may be placed in .htaccess files. 
# It can be "All", "None", or any combination of the keywords: 
# AllowOverride FileInfo AuthConfig Limit 
# 
AllowOverride all 

# 
# Controls who can get stuff from this server. 
# 

# onlineoffline tag - don't remove 
# Require local 
Allow from all 
</Directory> 

하지만, 내 웹 사이트에 링크는 404 오류를 반환 http://localhost/conditions. 내 htaccess로 :

Options +FollowSymlinks 
RewriteEngine on 

# Conditions 
RewriteRule ^conditions pages/conditions.php [L] 

모든 파일은 WAMP의 루트에 (C :/WAMP/www /에서).

도움말 :(httpd.conf에서

+0

가능한 맞춤법 오류가 있습니까? 'RewriteRule^conditions $ /pages/conditions.php [L]'. 방금 일어났습니다.) – DeDee

+0

.htaccess는'C : /'에 어디에 있습니까? – anubhava

답변

1

, 당신이이 라인가있는 경우 :.

#LoadModule rewrite_module modules/mod_rewrite.so 

경우 예, 아마 당신은 를 만들 수있는 #

을 제거 가상 응용 프로그램의 별칭이있는 호스트의 호스트

이 경우 here 링크를 따르십시오.

이미 가상 호스트와 사용할 수 없도록 설정해야하는 별칭이있을 수 있습니다. 파일 (호스트 파일, conf 파일 등)을 확인하십시오..

+0

** LoadModule rewrite_module modules/mod_rewrite.so ** 줄의 주석 처리가 이미 취소되었습니다. 그리고 가상 호스트가 없습니다. – Nowis

0

Windows 탐색기로 htaccess 파일을 만들지 마십시오. 메모장에 새 파일을 만들어 .htaccess 파일로 저장해야합니다.

관련 문제