0

I am new in zf2. Please help me. I setup my new zend project on www.example.com/zend/ directory but it didn't call directly. Its call via www.example.com/zend/public

How can i access directly access by www.example.com/zend/ this url. I don't want to any changes in virtual host. I want only use of .htaccess file.

Kindly suggest me solution.

edigu
  • 9,878
  • 5
  • 57
  • 80
Rahul
  • 5
  • 2
  • @ReNiSh A R, please do *not* make such pointless edits where you change `xyz` to `example`... this does *not* improve this question *in any way*. – Sheridan Jan 30 '14 at 09:55
  • @Sheridan for demonstration and illustration we have to use the domain example.com. xyz.com is a website that owned by another. we dont have provinsion to use it... – ReNiSh AR Jan 30 '14 at 09:57
  • @Sheridan: check: http://meta.stackexchange.com/questions/120929/suggest-the-usage-of-example-com-for-examples-when-urls-are-encountered – ReNiSh AR Jan 30 '14 at 09:59
  • 1
    @ReNiShAR, I accept your point and retract my statement. – Sheridan Jan 30 '14 at 11:27

2 Answers2

1

Setup an htaccess file in your /zend/ directory:

RewriteEngine On
RewriteBase /zend/
RewriteRule ^(?!public/)(.*)$ public/$1 [L]
Jon Lin
  • 142,182
  • 29
  • 220
  • 220
0

This is not possible in Apache web server. You can define virtual hosts only in .conf files, but not in .htaccess files.

OlegKrivtsov
  • 752
  • 4
  • 9