Home > Enterprise >  .htaccess skip apple-app-site-association but filter other
.htaccess skip apple-app-site-association but filter other

Time:12-05

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

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]

CodePudding user response:

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.

  • Related