1
Kmac01
Re: .htaccess help
  • 2006/7/2 21:36

  • Kmac01

  • Just popping in

  • Posts: 4

  • Since: 2006/6/3 2


Quote:

Peekay wrote:

FTP in ascii mode. Will automatically convert linefeeds to Unix/Linux format. Always FTP PHP files in ascii mode for this reason.


True, but my situation is a little different. I use samba to map a share over my network. Then I can edit the files directly and don't need to ftp anything.



2
Kmac01
Re: .htaccess help
  • 2006/7/2 21:30

  • Kmac01

  • Just popping in

  • Posts: 4

  • Since: 2006/6/3 2


Quote:

Dave_L wrote:
Thanks, that's one solution I could use.

But there must be some way to do this with a Location directive in an .htaccess file, or a similar directive such as LocationMatch, Files or FilesMatch. If not, what's the point of allowing these directives in .htaccess files?


Well, during my testing I found the FilesMatch to be more for blocking a file or type of file like images. If you use <FileMatch test.html> then that one particular file will be blocked (works with wildcards also) but I could not get it to work on a directory only files. And I think the LocationMatch is also only allowed in the httpd.conf file not .htaccess.



3
Kmac01
Re: .htaccess help
  • 2006/7/2 21:09

  • Kmac01

  • Just popping in

  • Posts: 4

  • Since: 2006/6/3 2


Quote:

Peekay wrote:

Create the file in any text editor (e.g. notepad)
Select 'File/Save As'.
In the 'Save as type' box select 'All Files (*.*)'
In the 'File name' box change file name to .htaccess
Click Save.


That works for filename issues, but you still end up with a file in windows format (end of line is CR/LF) whereas unix format the end of line is just a line feed (LF). If you open up a files saves as above with the unix vi it will say [DOS].

Sometimes unix/linux systems will not work properly with these files.



4
Kmac01
Re: .htaccess help
  • 2006/7/2 18:46

  • Kmac01

  • Just popping in

  • Posts: 4

  • Since: 2006/6/3 2


I did lots of testing on this, but the only way I can get it working is to add the <Directory> directive to the main httpd.conf file for appache. Any directives that seem to apply are only available in the main config file, not .htaccess files. (And you must restart apache for the changes to take effect)

On a side note, when creating files in windows that are for a unix environment I use my favorite text editor PFE32. It will allow you to save files in unix format. It also has tons of useful options like macros. It also runs great from a USB drive so you can always have it with you. You can grab a copy from my downloads section athttp://basicstuff.info
Quote:

Creating .htaccess files in Windows is challenging. If I recall correctly, you can create the file from a DOS prompt by renaming another file. Or else I create it on Linux, and then copy it into Windows.




TopTop



Login

Who's Online

214 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 214


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits