Currently I have this set up in my .httaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(php|html|txt|js|css|png|jpe?g|gif|svg|woff|ico|csv|xml|pdf|gzip)
RewriteCond %{REQUEST_URI} !^/?$
RewriteRule (.*) /$1.php [L,R=301]
so basically I am redirecting all URLs that do not have any extensions to php pages.
for example I redirect /test
to /test.php
and I throw 301 while I do this.
What I would like to have is first throw 404 on /test
and immediately after throw 301 and redirect to /test.php
.
Is it possible to write something either to .htaccess
or in apache .conf
files to achieve this?