if I could send the servername to the rewrite rule
Posted: Fri Jun 08, 2012 5:51 pm
I have a group of websites as subwebs in an account. They share a common code base, I use aliases so they can share CSS files, etc., and I would like them to share a set of rewrite rules (which create 'clean' urls).
Problem is, if I put the code in a htaccess file in the document root of the individual websites, all works fine, but if I put the htaccess file above that (or put them in http.conf), where they can share it, the rules seem confused regarding the appropriate document root, and I get messages like: "The requested URL /page/67/ was not found on this server."
This is not an issue of the rules applying but the page being confused about the location of css files, etc. This is an issue of the rules either not applying at all or referring to an inappropriate location on the server.
It's pretty important that I not have to manage a htaccess file in each subweb. Any ideas on how to resolve this? I will post the rules:
Problem is, if I put the code in a htaccess file in the document root of the individual websites, all works fine, but if I put the htaccess file above that (or put them in http.conf), where they can share it, the rules seem confused regarding the appropriate document root, and I get messages like: "The requested URL /page/67/ was not found on this server."
This is not an issue of the rules applying but the page being confused about the location of css files, etc. This is an issue of the rules either not applying at all or referring to an inappropriate location on the server.
It's pretty important that I not have to manage a htaccess file in each subweb. Any ideas on how to resolve this? I will post the rules:
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([0-9_-]+)/([0-9_-]+)/$ index.php?page_id=$1&language_id=$2 [NC,L]
RewriteRule ^([0-9_-]+)/?$ index.php?page_id=$1 [NC,L]
RewriteRule course/([0-9_-]+)$ index.php?course_id=$1 [NC,L]
RewriteRule program/([a-zA-Z0-9_-]+)$ index.php?url_keyword=$1 [NC,L]