htdocs and .htaccess

Problems with the Windows version of XAMPP, questions, comments, and anything related.

htdocs and .htaccess

Postby evow04 » 04. February 2009 14:52

Hi there!

i have a question i can not answer myself;

ive changed the documentroot to an other location in the httpd.conf.
kept /htdocs/xampp on the original place and linked it also in htdocs.
=>
Alias /xampp "C:/server/htdocs/xampp/"

<Directory "C:/server/htdocs/xampp/">
Order allow,deny
Allow from all
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
</Directory>

i got it working when i browse to localhost/xampp
now i wanted to secure this location and whent to /security to perform the script thats included.
i got a message saying it was completed, but when i browse to /xampp it does not give me login screen like it should.

I´m guessing that it is because i replaced /xampp location.

Is this correct thinking and how do i solve this?
thanks!
evow04
 
Posts: 9
Joined: 12. December 2008 10:25

Re: htdocs and .htaccess

Postby dmphotography » 04. February 2009 22:58

I'm not completely sure I understand what you're doing, but here's a go at it.

From what I can tell, you're creating an Alias and this has nothing to do with .htaccess.
Secondly, you put the Alias in the wrong place. It should go in the /apache/conf/extra/httpd-xampp.conf file and not the httpd.conf file.

Also, you do not need to create an Alias for xampp if your xampp folder is in your htdocs folder as you're showing. That makes no sense. I recommend changing everything you've done so far here back to default.

The xampp security isn't designed to keep on being used. It's designed to be used once as far as I can tell.

So that brings us to what you're trying to achieve. . .

THE .HTACCESS FILE.

This file is actually quite simple. With your text editor, such as Notepad, create a new text document, then put the directives you want in it. You can visit Apache's documentation on the .htaccess file for more info on that. http://httpd.apache.org/docs/2.0/howto/htaccess.html

I've also made a tutorial that explains the .htaccess file. MyOwnServer - .htaccess and .htpasswd.

This is a really neat file considering everything you can do with it and I recommend reading more about it.

But yeah, you can leave the Alias off and just put a .htaccess file in your htdocs/xampp folder and you'll achieve what I believe you're trying to do.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

Re: htdocs and .htaccess

Postby evow04 » 05. February 2009 11:44

hi dmphotography ;

it is really easy what i would like to change;
im not willing to use the ../xampp/htdocs as documentroot.
i´m willing to keep this folder just for the xampp ´site´.

the main document root should become ../xampp/documentroot

so in httpd.conf i change the doc root to ../xampp/documentroot
i can then add the alias (in the httpd-xampp.conf like you say) for /xampp to ../xampp/htdocs/xampp

but when doing this the security wont work any more.
it is problably something simple but i can not find why it does not work.

ill try to read the links provided.
evow04
 
Posts: 9
Joined: 12. December 2008 10:25

Re: htdocs and .htaccess

Postby dmphotography » 05. February 2009 18:46

Oh, I understand now. You don't need .htaccess for that. And yes, do put your Alias in the httpd-xampp.conf file.

As far as your issue with the Security not working, please post what error you're getting. The security is set up as an Alias too, so it should work with http://localhost/security no matter what you change the document root to. Now it is set to only be accessible via localhost/127.0.0.1, so if you're trying to access it from another computer, it won't work.

But yeah, post your error.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 64 guests