Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have some old html pages that have SSI includes in them to include certain html in all the pages.

So, the SSI looks something like this:

<!--#include virtual="/includes/noNav/footercode.html"-->

But I want to move that included file from /includes/noNav/footercode.html to /includes/footercode.html so I implemented a redirect in an .htaccess file like this:

# Redirect permanent /includes/noNav/footercode.html  http://intranet.myorg.org/includes/footercode.html

But now I get errors saying "unable to include "/includes/noNav/footercode.html" in parsed file" So, do redirects not work on included files?

Also, if I browse directly to the old path, it will correctly redirect me. But it fails if the path is included.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The SSI is parsed as part of the apache SSI module and does not make web requests back to Apache in order to retrieve the file. As it does not use HTTP back to Apache to retrieve the files specified by #include, no rewrite or redirect rules are applied.

The virtual= directive finds a file starting at ServerRoot, while the file= directive finds a file in the same directory as the current page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.