Question

So, I wanted to organise my projects for better developing. I chose using this way to organise folders & files:

www
    projects
        project1
           web
           design_tests
        project2
           web
           design_tests
...

The website of each project will go inside its "web" folder. I also wanted to access the web on the browser without putting the "web" folder name, so:

http://localhost/projects/project1
will access the physical files of:
/www/projects/project1/web

I accomplished that adding the next line to my /etc/apache2/sites-available/default file:

AliasMatch ^/projects/([^/]*)(/.*)? /www/projects/$1/web$2

Works perfectly. The problem is, in some websites, i have an .htaccess file with some RewriteRule rules. An example:

RewriteEngine On
RewriteRule styles\.css styles_20120107.css

They used to work without the alias and acessing normal. Now they don't. It redirects to the URL /project1/web/styles_20120107.css, and of course, the browser can't get it because of the Alias. I don't really know how to solve it. Can you give me some help about it please? If possible, doing modifications in the file /etc/apache2/sites-available/default, not on the .htaccess, because i want the websites to be cross-server.

Thanks in advance :)

Était-ce utile?

La solution

If adding [PT] flag does not work for you ... why not replace alias thing with rewrite rule to achieve the same -- in this case you should avoid this issue altogether.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top