httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chirouze Olivier" <olivier.chiro...@volvo.com>
Subject RE: [users@httpd] URLRewrite Question
Date Fri, 02 Feb 2007 14:25:17 GMT
Hi,
 
I guess you should add [L] ("last") to your first rule, and make sure
the second one is AFTER. Thus, the first rule will work for *.html, and
exit. When calling *.php, it will go to the second one...
 
RewriteEngine on
RewriteRule ^([0-9a-zA-Z]+)\.html$ $1.php [L]
RewriteCond %{REQUEST_URI}  "\.(php)$"
RewriteRule .* - [F]

Olivier
 

Olivier CHIROUZE
I&0 Infrastructure 
Volvo Information Technology 

 


________________________________

	From: Feris Thia [mailto:feris.apache.httpd@gmail.com] 
	Sent: 02 February 2007 15:16
	To: users@httpd.apache.org
	Subject: [users@httpd] URLRewrite Question
	
	
	Hi Everyone,
	
	I configured my .htaccess to map/redirect all my *.html page to
*.php pages like below
	
	================================
	RewriteEngine on
	RewriteRule ^([0-9a-zA-Z]+)\.html$ $1.php
	================================
	
	It works. But now, I want the client cannot access the php
script directly. So I write the rule like these
	
	================================
	RewriteCond %{REQUEST_URI}  "\.(php)$"
	RewriteRule .* - [F]
	================================
	
	But now it forbid every *.html  that maps to my *.php pages...
What is wrong ? How can I achieve my goal ? 
	
	
	Regards,
	
	Feris
	

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message