'-f' (is regular file)

Using mod_rewrite to handle various content issues

'-f' (is regular file)

Postby Abstractt » Mon Sep 15, 2008 5:04 am

Hi Everyone,

I just created a very simple .htaccess file put it online and made the following request:

http://domain.com/test.php?ja.html

The htaccess file contains:

RewriteEngine on

RewriteCond %{QUERY_STRING} -s
RewriteRule ^.+$ ja.html [L]
RewriteRule ^.+$ nee.html [L]

The files ja.html/nee.html exists and are bigger then zero files
After my request I'm getting the 'nee.html' document. I would think it has to be the 'ja.html' document.

The next test I did was changing the .htaccess file to:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^.+$ ja.html [L]
RewriteRule ^.+$ nee.html [L]

The request I made was:

http://domain.com/test.php

I made sure there was a file called test.php in the root and the size was bigger then zero.

That worked perfect. Why is the first example not working?

Arian
Abstractt
 
Posts: 1
Joined: Mon Sep 15, 2008 4:53 am

Postby richardk » Mon Sep 15, 2008 10:46 am

You probably need a full path. Try
Code: Select all
Options +FollowSymLinks

RewriteEngine on

RewriteCond %{DOCUMENT_ROOT}/%{QUERY_STRING} -s
RewriteRule . /ja.html [L]

RewriteRule . /nee.html [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Content

Who is online

Users browsing this forum: No registered users and 15 guests

cron