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ドル/web2ドル
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 :)
1 Answer 1
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.
Comments
Explore related questions
See similar questions with these tags.
[PT]flag for such rewrite rule: httpd.apache.org/docs/current/rewrite/flags.html#flag_ptRewriteRule styles\.css styles_20120107.css [PT](assuming your rule is correctly working). I do not have (and never had) this kind of rewrite rule where incoming and outgoing file are in the same location. I have always had similar to what you see in that link, where new rewritten url has alias in it and it works just fine withPTflag. BTW -- instead of doing that alias thing -- better use rewrite rule to achieve the same -- in this case you should avoid this issue altogether