Doing Apache stuff with Windows

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
f1nutter
Forum Contributor
Posts: 125
Joined: Wed Jun 05, 2002 12:08 pm
Location: London

Doing Apache stuff with Windows

Post by f1nutter »

Hi guys,

My hosting account is based on Linux and allows .htaccess files for password protection/custom error pages etc. I have developed custom 404 pages and am looking at preventing hot linking to my images as well as future .htaccess functions.

I am using PWS with Win98. My first problem is that Windows will not allow me to name my files .htaccess or anything starting with a period. It says "You must type a filename".

1) Is there any way of sorting the filename name thing out
2) What would I need to enable me to serve these pages.

I cannot keep transfering my files and renaming them on the server and then testing, as I have limited connection time. PWS works well with ASP/Access and PHP/MySQL so I would like to stay with Windows only.

Cheers.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

in dreamweaver you can name a file without any warning, if you do it in the windows directory browser, your sure to have them errors as i did.

If you don't have dreamweaver, try notepad. 8)

hope it helps...
f1nutter
Forum Contributor
Posts: 125
Joined: Wed Jun 05, 2002 12:08 pm
Location: London

Post by f1nutter »

I haven't got dreamweaver. Notepad will allow you to name the file .htaccess, but will add .txt to the end, even if you change the "Save as type" box to *.* When I then delete the .txt from .htaccess.txt it complains.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Not when i use notepad...

hmm i just did and it worked fine..

make sure to unselect "Save As.." type from .txt to "*.* All Files"

then it should be ok to save it.

if your still having problems, maybe i can send you a blank one...
lc
Forum Contributor
Posts: 188
Joined: Tue Apr 23, 2002 6:45 pm
Location: Netherlands

Post by lc »

yeah... I doubt whether that's avoidable in win98. I just tried it and yer right. doesn't work.

So why not name it 1.htaccess , upload it , then rename it once it's on the server.

Not perfect, but should work.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

it's only a restriction in the explorer (why ever).
just name it i.e. htaccess and open a console where you move the file to .htaccess .
Or get an editor that does not care about file extensions. I like ultraedit - but that's just a matter of opinion.


But I doubt PWS is supporting .htaccess-protection.
On the other hand there is http://www.apache-asp.org/. So you may want to turn over to apache ;)
f1nutter
Forum Contributor
Posts: 125
Joined: Wed Jun 05, 2002 12:08 pm
Location: London

Post by f1nutter »

For future reference:

I created my htaccess file in Notepad and saved the file as htaccess.txt . I then opened a DOS window and moved to the directory containing the htaccess file. Then I renamed the file through DOS.

Code: Select all

F:\> ren htaccess.txt .htaccess
ren is rename, space, then original filename, space, new file name.

I though Windows was based on DOS, so if DOS will do it why won't Windows -- over to you Bill!

PS. I'm downloading Apache now.
User avatar
sjunghare
Forum Newbie
Posts: 16
Joined: Tue Sep 03, 2002 6:22 am
Location: Pune

Post by sjunghare »

Create a FILE using a notepad as enter u r require text and make sure to select "Save As.." type from .txt to "*.* All Files" and file name in dobule quote ".htaccess" It works and I done it.
f1nutter
Forum Contributor
Posts: 125
Joined: Wed Jun 05, 2002 12:08 pm
Location: London

Post by f1nutter »

I hadn't enclosed it in double quotes, it works - pukka.

Now to configure Apache2 for Windows - don't go far guys!


Thanks.
Post Reply