url - Apache FilesMatch directive to match requested domain -


i'm trying setup filesmatch directive in such way when user requests resource matches domain name, resource served.

for example:

example.com/example.com.html = good

example.com/other.com.html = not allowed, serves error.html instead

i'm considering configuring apache so:

<filesmatch regexp+domain_name+regexp>     allow resource... </filesmatch> 

but achieve effect need have domain of request variable somehow.

any advice appreciated.

this option doesn't check if file exists, if matches desired pattern:

rewriteengine on rewritecond %{request_filename} !-f [or] rewritecond %{request_filename} ^%{server_name}\.html$ rewriterule ^ - [f] 

there more ways it, rewriting gives , powerful options. require mod_rewrite activated though.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -