Say I have an htaccess:
<code>RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9^/]+)/?(.*)$ /folder/file.php?fldr=$1 [NC,L,QSA]
</code>
<code>RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9^/]+)/?(.*)$ /folder/file.php?fldr=$1 [NC,L,QSA]
</code>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9^/]+)/?(.*)$ /folder/file.php?fldr=$1 [NC,L,QSA]
This works fine, and redirects anything that reaches this level of the htaccess file.
Now, I want to add a qualifier that this should only run if the filename is only a-z
or 0-9
latin characters.
<code>RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} (a-z0-9) #Example here
RewriteRule ^([a-z0-9^/]+)/?(.*)$ /shopping/business.php?fldr=$1 [NC,L,QSA]
</code>
<code>RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} (a-z0-9) #Example here
RewriteRule ^([a-z0-9^/]+)/?(.*)$ /shopping/business.php?fldr=$1 [NC,L,QSA]
</code>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} (a-z0-9) #Example here
RewriteRule ^([a-z0-9^/]+)/?(.*)$ /shopping/business.php?fldr=$1 [NC,L,QSA]
But I can’t find any guidance how to do this. Any suggestions?