Jump to content

Recommended Posts

hi

 

i tried this code, but i get an error because the last line

RewriteRule \.php$ - [R=404,L]

 

RewriteEngine on

# allow example.com/foo
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.php$
RewriteRule ^(.+)$ /$1.php?myvar=0 [L]

# but don't allow example.com/foo.php
RewriteCond  %{QUERY_STRING} !^myvar=0$
RewriteRule \.php$ - [R=404,L]

 

any idea? i want to redirect the access to all files with termination with .php

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/232760-internal-error-500/
Share on other sites

log

 

 

[Tue Apr 05 16:16:26 2011] [notice] Child 3972: Child process is running

[Tue Apr 05 16:16:26 2011] [notice] Child 3972: Acquired the start mutex.

[Tue Apr 05 16:16:26 2011] [notice] Child 3972: Starting 250 worker threads.

[Tue Apr 05 16:16:26 2011] [alert] [client 127.0.0.1] C:/Users/fel/VertrigoServ/www/.htaccess: RewriteRule: invalid HTTP response code for flag 'R'

Link to comment
https://forums.phpfreaks.com/topic/232760-internal-error-500/#findComment-1197230
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.