Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
3 + 8 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: .htaccess help
by Peekay on 2006/7/2 22:25:10

Quote:

Bender wrote:
(ever tried to create a file named .htaccess under windows ... well thats why i can“t test it here with xampp and my sites are all shared hosting so i have no access to httpd.conf.


To use .htaccess and mod_rewrite with XAMPP, you have to edit xampp/apache/conf/http.conf

1) Check around line 221 the entry:
AddType application/x-httpd-php .php .php3 .phtml
and make sure the .phtml extension is present.

2) Around line 414, check that the entry specifies the .htaccess file:
AccessFilename .htaccess

3) Around line 166, uncomment the Line:
#LoadModule rewrite_module modules/mod_rewrite.so

4) Check the entry around line 362. If it reads:
AllowOverride None
change it to:
AllowOverride All

You need to re-start the Apache server for the effects to take place.

Mod_rewrite may already be enabled on your shared server. Not all hosts allow you to create .htaccess files, but if yours does, upload two files - test1.html and test2.html - and place a simple .htaccess file in the same folder. The contents should read:

le="color: #000000"><?php # Test rewrite is on RewriteEngine On RewriteRule ^test1.html$ /test2.html [R=301] #


If you then enter the URL to test1.html in a browser and wind up looking at test2.html... it's working.
Re: .htaccess help
by Peekay on 2006/7/2 22:00:13

Ah, I see. Not so good then.

We now FTP all files between the Linux box, Macs and PCs in my studio because of the linefeed issue. It's drag-n-drop with the new FTP apps so we don't really find it a hassle.

I would have thought Samba would have catered for the discrepancy?
Re: .htaccess help
by Kmac01 on 2006/7/2 21:36:54

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.
Re: .htaccess help
by Kmac01 on 2006/7/2 21:30:52

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.
Re: .htaccess help
by Peekay on 2006/7/2 21:30:06

Quote:

Kmac01 wrote:

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.


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

Who's Online

189 user(s) are online (147 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits