0

Please help with mod_rewrite subdomain to some Symfony2 routing. It is like 3 months now I spent time to solve this with my Symfony2 project but after reading tons of apache mod_rewrite and mod_alias documentation and trying hundreds of examples... it still doesn't work!

What I try to solve is, when user enter address of some specific subdomain: XXXXXXX.example.com

He sees content that is actually under
www.domain.com/tag/XXXXXXX/

but he is not redirected or URL isn't changed -- it should just stay XXXXXX.example.com as he enters.

I need to resolve this with Apache VirtualHost and sites-enabled file (not with SubdomainListener) but the most I can solve on my own with mod_rewrite is having

XXXXXXX.example.com

Rewriting (transparently) itself to

XXXXXXXX.example.com/tag/XXXXXXXX or
XXXXXXXX.example.com/app.php/tag/XXXXXXXX/

which of course is not what I try to achieve. I try to achieve internal (http://httpd.apache.org/docs/2.2/rewrite/remapping.html) redirection so user don't see that. Any help with working soultions would be otherworldly appreciated.

0

1 Answer 1

1

Since this commit, you can use subdomains in Symfony natively, but unfortunately it's a Symfony 2.2 feature. If you need subdomains, this still is the best way to do this, however.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for bringing this up. Maybe someday I could use it with Symfony 2.2. I wonder if there is Apache VirtualHost solution for that. I really need it.
I'm not sure about that, I've tried to do that too unsuccessfully :( Symfony 2.2 is in beta phase though, I think it's pretty safe to use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.