Re: [PHP] Apache RewriteRule Help!!!!
El Fri, 13 Jun 2008 10:23:29 -0400 Daniel Brown [EMAIL PROTECTED] escribió: You can start by asking your question on an Apache list. This has nothing to do with PHP. ;-P To answer your question, use this in your .htaccess file: RewriteCond %{SCRIPT_FILENAME} index RewriteCond %{QUERY_STRING} ^[a-zA-Z0-9] RewriteRule .* http://www.yourdomain.com/404.php [L] Next time, though, please try to ask questions on the appropriate lists. I did write to the apache users list at the same time more or less and still waiting a reply :'( --- .-. | Miguel J. Jiménez | | Sector Público, ISOTROL S.A.| | [EMAIL PROTECTED] | :-: | KeyID 0xFFE63EC6 hkp://pgp.rediris.es:11371 | :-: | Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.| | Parque Tecnológico Cartuja '93, 41092 Sevilla (ESP).| | Tlfn: +34 955 036 800 (ext.1805) - Fax: +34 955 036 849 | | http://www.isotrol.com | :-: | UTM ED-50 X:765205.09 Y:4144614.91 Huso: 29 | :-: | Me dijeron: 'instala Windows, se listo'; así que | | instalé primero Windows y luego fui listo y lo borré| | para instalar Linux| '-' signature.asc Description: PGP signature
[PHP] Apache RewriteRule Help!!!!
Hi, I am having a little problem here, I have a .htaccess that looks thus: RewriteEngine on RewriteBase /INDEX RewriteRule ^(.*\.(log|sqlite))$ index.php [L] RewriteRule ^(.*\.(js|css|png|jpg|gif|xml))$ [L] RewriteRule ^(.*)$ index.php?m=$1 [L,QSA] When I type http://foo/INDEX/mp3; it goes [internally] to http://foo/INDEX/index.php?m=mp3;. Great so far... The problem is when I try to forbid access to http://foo/INDEX/index.php?m=mp3; for the user. I mean if the user types http://foo/INDEX/index.php?m=mp3; I want the apache to send a redirect code or something... I tried: RewriteCond %{IS_SUBREQ} false RewriteRule index.php - [L,NS,R=404] ...just below the line RewriteBase /INDEX but when I do this, it just redirect *always* even if I type http://foo/INDEX/mp3;. How can I make apache work fine with http://foo/INDEX/mp3; and redirect to an error page (or moved url or wahtever) with http://foo/INDEX/index.php?m=mp3; (from the client view) thanks for the help --- .-. | Miguel J. Jiménez | | Sector Público, ISOTROL S.A.| | [EMAIL PROTECTED] | :-: | KeyID 0xFFE63EC6 hkp://pgp.rediris.es:11371 | :-: | Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.| | Parque Tecnológico Cartuja '93, 41092 Sevilla (ESP).| | Tlfn: +34 955 036 800 (ext.1805) - Fax: +34 955 036 849 | | http://www.isotrol.com | :-: | UTM ED-50 X:765205.09 Y:4144614.91 Huso: 29 | :-: | Me dijeron: 'instala Windows, se listo'; así que | | instalé primero Windows y luego fui listo y lo borré| | para instalar Linux| '-' signature.asc Description: PGP signature
Re: [PHP] Apache RewriteRule Help!!!!
On Fri, Jun 13, 2008 at 4:11 AM, Miguel J. Jiménez [EMAIL PROTECTED] wrote: How can I make apache work fine with http://foo/INDEX/mp3; and redirect to an error page (or moved url or wahtever) with http://foo/INDEX/index.php?m=mp3; (from the client view) You can start by asking your question on an Apache list. This has nothing to do with PHP. ;-P To answer your question, use this in your .htaccess file: RewriteCond %{SCRIPT_FILENAME} index RewriteCond %{QUERY_STRING} ^[a-zA-Z0-9] RewriteRule .* http://www.yourdomain.com/404.php [L] Next time, though, please try to ask questions on the appropriate lists. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php