: Modify .htaccess to allow existing files without extension to be served I have the following .htaccess: #If the requested URI does not end with an extension OR if the URI ends with .php* #(where
I have the following .htaccess:
#If the requested URI does not end with an extension OR if the URI ends with .php*
#(where * is optionally one or more numbers)
RewriteCond %{REQUEST_URI} !.[^/]+$ [NC,OR]
RewriteCond %{REQUEST_URI} .php[s0-9]*$ [NC]
#Then serve the URI via the mapper
RewriteRule .* /mapper.php?uri=%{REQUEST_URI} [L,QSA]
I would like to add the following conditions to it:
The file actually exists
And is without an extension
So the entire file would do something like this:
IF (requested URI does not end with an extension) OR (URI ends with .php*) THEN
rewrite the URI
END
IF (file exists) AND (file requested does not end with an extension)
rewrite the URI
END
More posts by @Sims2060225
1 Comments
Sorted by latest first Latest Oldest Best
Perhaps something like this:
RewriteCond %{REQUEST_FILENAME} -s
RewriteCond %{REQUEST_URI} .php[s0-9]*$ [NC]
RewriteRule .* /mapper.php?uri=%{REQUEST_URI} [L,QSA]
RewriteCond %{REQUEST_FILENAME} -s
RewriteCond %{REQUEST_URI} !.[^/]+$ [NC]
RewriteRule .* /mapper.php?uri=%{REQUEST_URI} [L,QSA]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.