Is there a way to write notes in .htaccess file like we do in html or css files? If yes how?
| SitePoint Sponsor |
Is there a way to write notes in .htaccess file like we do in html or css files? If yes how?

Yes, start the line with a #
![]()
Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy


Yes. If they are just on one line, you can just put // at the start of the line to make it a comment.
If your comment goes over multiple lines, I believe you can wrap those lines in /* */ (like PHP and CSS) but test this out rather than taking my word for it, as I'm not sure if it works in all circumstances.
Edit:
Beaten to it—no doubt with a better answer!
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.
Is this how its done # Redirect 301 /example.html http://www.domain.com/example.html


Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.
thanks i'll try now
works great thanks

For reference, // and /* */ do NOT work in .htaccess. only #
Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy

SES & Ralph,
That (# anywhere on the line will render anything following it as a comment) was the best answer for a one-liner but you can comment out an entire block of mod_rewrite code using the RewriteEngine on|off directive. Obviously,The only warning I can provide is that the RewriteEngine directive is specific to mod_rewrite code processing so don't use it to comment out Apache directives!Code:RewriteEngine on # bunch of mod_rewrite code - enabled by the 'on' RewriteEngine off any mod_rewrite code which needs to be disabled RewriteEnging on # return to mod_rewrite processing
Yes, I get too focused on mod_rewrite but this is a very useful way to comment out mod_rewrite code.
Regards,
DK
David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
Updated mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
Bookmarks