0

My application webroot is like : /home/username/appname/public_html

I have created a subfolder under public_html and installed the wordpress there.

Like: /home/username/appname/public_html/subfolder

we used the below redirection code because we want to access the application like https://example.com/subfolder

RewriteEngine on
RewriteCond %{HTTP_HOST} example\.com [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://example.com/br/$1 [L,R=301,NC]
RewriteRule ^/?(.*)$ http://example.com/br/$1 [L,R=301]

so when user will access main domain example.com so req will be redirected to example.com/subfolder/

but now we want to access example.com/file.txt

but the problem is due to redirection it also redirecting

so how can I exclude this url example.com/file.txt from redirection to example.com/subfolder/file.txt

Please help us.

I tried to add these config but did not work for me

RewriteCond %{REQUEST_URI} !^/file\.txt$

OR

RewriteCond %{REQUEST_URI} !^example\.com\/file\.txt$
Amit Verma
  • 40,709
  • 21
  • 93
  • 115

0 Answers0