Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

.htaccess skip apple-app-site-association but filter other

I have a rule for changing the extension

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^item/(.*)/?$ item.php/$1 [NC,L]
RewriteRule ^([^.]+)$ $1.php [NC,L]

All fine But this rule also filter apple-app-site-association

Need skip apple-app-site-association but filter other

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried add code below but to no avail

RewriteRule ^apple([a-z]+)$ $1 [NC,L]
RewriteRule apple-app-site-association$ $1 [NC,L]
RewriteRule ^apple([a-z]+)$ $1 [NC,L,S=2]

>Solution :

You can use the following:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^item/(.*)/?$ item.php/$1 [NC,L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^.]+)/?$ $1.php [NC,L]

The condition above makes sure you don’t rewrite your existing files and folders.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading