Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using Zend Framework but I have a little problem: How could I redirect internal all requests from

localhost/zendframework/

to

localhost/zendframework/www/

What have to put into my .htaccess in the folder localhost/zendframework/?

share|improve this question

4 Answers

You can use the "Alias" Directive in your apache config file.

Alias /zendframework /path/to/zendframework/www
share|improve this answer

It sounds like you want to setup a virtual host. If that's the case, then look into apache documentation according to the version you are using. There's been a slight change in how it's taken care in apache 2.2 and 2.4.

share|improve this answer

You should be able to add this in your .htaccess in the /zendframework directory.

Redirect permanent / http://localhost/zendframework/www
share|improve this answer
My questions wasn't clear: I want to have a internal redirect; I mean that all requests from "localhost/zendframework/" should acess the files in "localhost/zendframework/www/". Another example: I access "localhost/zendframework/image.png" (url in the adress bar is the same) and apache should get the file in "localhost/zendframework/www/image.png" without changing the url. – user28436 Dec 8 '09 at 14:15

You did not say which kind of web server you are using. Assuming it is a recent Apache httpd, your might take a look at the documentation, especially this useful example in the rewriting guide - might be exactly what you are looking for.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.