Forum Moderators: phranque

Message Too Old, No Replies

.htaccess file. I don't know why

why upload .htaccess file.and it can't work

         

heamon

6:44 am on Dec 23, 2006 (gmt 0)



now,i do this:
[aaa.example.net...] ->http://www.example.net/aaa/index.html
the code in the .htaccess is:
RewriteEngine on
RewriteCond %{ENV:rwdone}!^yes$
RewriteCond %{HTTP_HOST}!www\.example\.net
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9\-]+)\.example\.net
RewriteRule (.*) /%2/$1 [E=rwdone:yes,L]

why i upload the .htaccess file in the space, it can't work and no error

RewriteRule ^foo\.html /lv.html [R=301,L] can work

don't know why!
please help me!

heamon

8:07 am on Dec 23, 2006 (gmt 0)



And I have Found:
if i have more virtualhost
<virtualhost _default_:80>
servername one
......
</virtualhost>
<virtualhost _defautl_:80>
servername two
........
</virtualhost>

if the .htaccess in the top virtualhost document root, the .htaccess can work, but if the .htaccess in the two virtrualhost ,it can't work

why? the .htaccess must in the top of all the virtualhost?

if i bought space,that have many person use it , how can i use .htaccess, i don't know whether my virtual is in the top

please tell me! thank you!

jdMorgan

3:02 pm on Dec 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See Apache mod_rewrite documentation for FollowSymLinks or SymLinksIfOwnerMatch requirement
See Apache core documentation for the directive Options
See Apache core documentation for the directive AllowOverride

Jim