Search

My host’s servers are configured such that top-level directories can also be accessed as sub-domains. So http://example.com/foo will also work as http://foo.example.com/. That is, until Symphony’s .htaccess file is added to the mix.

I have a static page that I would like addressed at foo.example.com/. Direct requests for files (foo.example.com/index.html, foo.example.com/image.png, foo.example.com/style.css) work as expected, but requests for the root (foo.example.com/) are intercepted by Symphony and return my Symphony site’s index page.

It's easy to intercept requests for the subdomain and route those to the corresponding file in the directory:

RewriteCond %{HTTP_HOST} ^foo.(.+)$ [NC]
RewriteRule ^(.*)$ foo/$1 [L]

But what I can't figure out is how to route requests for the root and route them to the index file. This does not work:

RewriteCond %{HTTP_HOST} ^foo.(.+)$ [NC]
RewriteRule ^(/?)$ foo/index.html [L]

Any thoughts?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details