3

I have a server, where I have uploaded my work in zend framework(in a subdomain). the folder name is 'visit'.

So, When I go to: http://mysitename.com/visit, it shows a directory structure:

Parent Directory
application/
docs/
library/
nbproject/
public/
tests/

But when I go to: http://mysitename.com/visit/public, i get the index page of my project.

But I want to get my index page , when I type: http://mysitename.com/visit

can you please give me the correct htaccess it need?

Charles
  • 50,943
  • 13
  • 104
  • 142
tarique
  • 2,201
  • 5
  • 19
  • 28

2 Answers2

3

Also, these other approaches to deploying in shared hosting can help:

In particular, an answer by tharkun led me to write it up in more detail in a blog post.

Community
  • 1
  • 1
David Weinraub
  • 14,144
  • 4
  • 42
  • 64
0

You can do this with the following rule set, which is in part a partially modified version of the one described in the documentation.

.htaccess file in /visit:

RewriteEngine on

# Guard against people visiting /public/ directly
RewriteCond %{THE_REQUEST} ^[A-Z]\s/visit/public/
RewriteRule ^public/(.*)$ /visit/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
# Make sure we've rewritten to the ./public/ directory already
RewriteCond $0 ^public/
RewriteRule ^.*$ - [NC,L]
# The index file is now at /visit/public/index.php
RewriteRule ^.*$ /visit/public/index.php [NC,L]
Tim Stone
  • 19,119
  • 6
  • 56
  • 66