0

Let's say that I have a subdirectory in my www folder called subdirectory. Is it possible to modify the .htaccess file so that all files contained within the subdirectory can be referenced inside other files like this: /somefile.extension? Therefore, I'd like the subdirectory to act as the root for all files inside it, and I don't want to use a subdomain.

1 Answer 1

1

Try this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://site.com/subdirectory/
RewriteCond %{REQUEST_URI} !^/subdirectory/
RewriteRule (.*) /subdirectory/$1 [L,QSA]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.