Syntax definition file for .htaccess?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
lost
Posts: 3
Joined: Sat Dec 23, 2006 12:04 pm

Syntax definition file for .htaccess?

Post by lost »

Hi

How can I add a .htaccess to any Syntax definition file? Under configure -> Document classes I have already add the file "*.htaccess".

If I renamed .htaccess to text.htaccess, the Syntax is highlighted. But in the right file .htaccess it doesn't work.


Greetings
Lost
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Have you tried without the asterisk?
lost
Posts: 3
Joined: Sat Dec 23, 2006 12:04 pm

Post by lost »

yes, sure
PeteTheBloke
Posts: 39
Joined: Fri Apr 22, 2005 8:15 am
Location: N. Ireland
Contact:

Post by PeteTheBloke »

I think this might be a Windoze issue more than a TP issue.

I have .htaccess files that I have FTPed from websites, but I can't rename a file to .htaccess in Windoze - it simply won't allow me.

The problem comes from the fact that the OS uses file extensions to recognise filetypes whereas *NIX (including Macs) looks at the file and works it out.

I think :)
BenjaminB
Posts: 10
Joined: Tue Sep 12, 2006 3:09 pm

Post by BenjaminB »

PeteTheBloke wrote:I have .htaccess files that I have FTPed from websites, but I can't rename a file to .htaccess in Windoze - it simply won't allow me.
It should work if you use the commandline. (Start->run->"cmd") Just type "ren [filename].[extension] .htaccess". Notepad can save files as .htaccess, too.

By the way: I tried syntax highlighting for .htaccess files and it works perfectly.
lost wrote:Under configure -> Document classes I have already add the file "*.htaccess".
Are you _sure_, that you added ".htaccess" _without_ the "*"? Because this sounds like you did not:
lost wrote:If I renamed .htaccess to text.htaccess, the Syntax is highlighted.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

BenjaminB wrote:Notepad can save files as .htaccess, too.
Textpad can do that as well - so there is no need to use horrible things like Notepad ...
lost
Posts: 3
Joined: Sat Dec 23, 2006 12:04 pm

Post by lost »

BenjaminB wrote:Are you _sure_, that you added ".htaccess" _without_ the "*"? Because this sounds like you did not:
Yes, I'm sure that I have only .htaccess without the * (I know, I had written in my first post with * :wink:)

I use the Syntax definition file "php-js-css-html.syn". In this file, I have added "RewriteRule", but nothing happens in the .htaccess. Only http-Links are blue.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Please open that syntax file.

What does it say in the first few lines?
Is there a
HTML = 1
?

If so, syntax coloring does only take place between < and > as far as I know (you could verify that by putting <RewriteRules> for a test in your file)

I do not understand why you chose a syntax file that is for html + css + php + js for something totally unrelated like Apache configuration - why not use one of the Apache syntax files from http://www.textpad.com/add-ons/syna2g.html ?
beychae
Posts: 4
Joined: Tue Feb 20, 2007 11:30 am

Post by beychae »

Check if you have "*." as a wildcard associated with another document class (I think the Text class has this by default).

If you remove this association, Textpad seems to allow other document classes to have members like ".htaccess" where the filename starts with a dot. Otherwise, they are all grabbed by the Text class.
Post Reply