redirect a virtual include

Discussion in 'Site & Server Administration' started by matc, Jan 12, 2005.

  1. #1
    Hello,

    I would like to find a way of successfully redirecting a call to one of our files made through a virtual include. The following redirect works quite happily when the file request is made directly through the browser address bar but if I call it via a virtual include it fails to redirect. This is an example of one of 500 redirects that will have to be made, all being piped through the same template_portal.sssi just with different params being passed.

    Any help on where I'm going wrong here would be most appreciated?

    The file request example:
    <!--#include virtual="/path/to/dir/file.shtml" -->
    Code (markup):
    Present RewriteRule example:
    RewriteRule ^file.shtml$ http://site.co.uk/path/to/new/dir/portal_template.sssi?location=#&region=#&product=#&type=#&nav=#&stick=#&id=#&q=# [R,L]
    Code (markup):
    Many thanks, mat
     
    matc, Jan 12, 2005 IP
  2. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #2
    flawebworks, Jan 12, 2005 IP
  3. matc

    matc Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi flawebworks,

    Cheers for the points and sounds about right autually. A friend reminded me that to fire the RewriteRule the call would need to be made as a HTTP request. As the include is handled differently by Apache this type of request never happens...

    I'm going look at zero'in the contents of the called file and daisy chaining the new code or include into it.

    Cheers again and thanks for the speedy reply.

    mat
     
    matc, Jan 13, 2005 IP