Jump to content


Photo

VirtualHost and .htaccess


  • Please log in to reply
4 replies to this topic

#1 sanjeevdivekar

sanjeevdivekar
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 September 2006 - 12:26 PM

Hi,

I am running Apache 2.0.54 with PHP 4.4.0 on Windows 2003 Box.
I have setup VirtualHost which is running fine except .htaccess file within that.
The Same thing works fine in htdocs folder (Apache Doc Root).

Please Help me I am doing first time PHP.

Regards,
Sanjeev Divekar

#2 R_P

R_P
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 13 September 2006 - 04:27 PM

Make sure that your AllowOverride directive contains AuthConfig, especially if your virtual host is using a different <directory>. This is really the only possible cause I can think of - besides the content of your .htaccess files being incorrect.
Pro in: Win2K3S | Apache2 | PHP5 | Perl5 | MySQL | MSSQL | Firefox | Photoshop
Student of: Ubuntu6 | Java | C | VB.NET | ASP.NET
Developer: Roddzilla Webstudios, Burrson CG, DVIDSHUB, The Four Nations
Student: Georgia Tech, Georgia Tech College of Computing

#3 sanjeevdivekar

sanjeevdivekar
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 September 2006 - 04:39 PM

Thanks for replay.

But I doing PHP 1st time so i am not getting what u say. Let me explain what I did.

in my .htaccess file there is only one line

DefaultType application/x-httpd-php


my VirtualHost lines are like this

<VirtualHost 127.0.0.1:8080>
    DocumentRoot "D:/Websites/mow/site/web"
    ServerName dev.mow.com
    ErrorLog logs/dev.mow.com.error.log
    CustomLog logs/dev.mow.com.access.log combined
    AccessFileName .htaccess
</VirtualHost>


what should i do?



#4 R_P

R_P
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 13 September 2006 - 04:48 PM

What kind of error are you getting, or are you not? Also, why do you need a DefaultType directive in .htaccess anyway? As long as you have configured PHP correctly and added the AddType, php will run anything with a .php (or whatever you chose) extension. Virtual hosts should inherit these configurations by default.
Pro in: Win2K3S | Apache2 | PHP5 | Perl5 | MySQL | MSSQL | Firefox | Photoshop
Student of: Ubuntu6 | Java | C | VB.NET | ASP.NET
Developer: Roddzilla Webstudios, Burrson CG, DVIDSHUB, The Four Nations
Student: Georgia Tech, Georgia Tech College of Computing

#5 sanjeevdivekar

sanjeevdivekar
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 September 2006 - 04:51 PM

As I said i never used PHP. this is my first experinec.
I am developing one small website for my client.
there are two points.
1. I want to hide .php extension. (I am successful when i run code in htdocs)
2. Authetication

I don't have client's server access where i can't modify httpd.conf file

When i run my script browser shows PHP source.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users