Reply
How do I make a simple .htaccess file?
Old 08-27-2008, 08:25 PM How do I make a simple .htaccess file?
TWD
Ultra Talker

Posts: 471
Trades: 0
I`ve never tinkered with .htaccess so I`ve no idea about the correct syntax for writing a file or what to put in it but I heard its just a simple text file.

Could someone show me how to write a file that does something simple?
I just need an example.

I`m using Dreamweaver in code view as my html text editor.

I`ve tried Googling but most of the tutorials are either too advanced or else they seem incomplete.

If somebody can recommend a good book for getting up to speed with all of the .htaccess tricks that would be excellent too.

cheers!
TWD is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 08-28-2008, 05:39 AM Re: How do I make a simple .htaccess file?
chrishirst's Avatar
Super Moderator

Posts: 21,639
Location: Blackpool. UK
Trades: 0
something simple:
Code:
DirectoryIndex home.php index.php
sets the site (or folder) to use either home.php OR index.php as the index page.

The Apache site is the best to work through. All "tutorials" will seem incomplete because there is no such thing as a complete .htaccess file. It comprises of many sections and each one is an independent entity, so a tutorial on some sections can be pretty comprehensive, but as a whole? Not a chance , the mod_rewrite section could take up a whole book.

HighRankings Redirect forum has lots and lots and lots of examples complete with code
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-28-2008, 05:54 AM Re: How do I make a simple .htaccess file?
mtishetsky's Avatar
King Spam Talker

Posts: 1,163
Name: Mike
Location: Mataro, Spain
Trades: 0
http://httpd.apache.org/docs/
__________________
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 08-31-2008, 05:02 AM Re: How do I make a simple .htaccess file?
Novice Talker

Posts: 9
Trades: 0
Here is an easy an useful example for setting up the canonical url:
Code:
RewriteEngine On 
Options +FollowSymlinks
RewriteCond %{http_host} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,NC]
__________________
Free Press Release
propress is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do I make a simple .htaccess file?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.12888 seconds with 13 queries