1

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]
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93
AC1D
  • 248
  • 5
  • 16

1 Answers1

1

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.

Amit Verma
  • 40,709
  • 21
  • 93
  • 115