Luka
Luka

Reputation: 1718

Making a subdirectory independent using the .htaccess file

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.

Upvotes: 0

Views: 191

Answers (1)

vmeln
vmeln

Reputation: 1309

Try this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://site.com/subdirectory/
RewriteCond %{REQUEST_URI} !^/subdirectory/
RewriteRule (.*) /subdirectory/$1 [L,QSA]

Upvotes: 1

Related Questions