www.webdeveloper.com
Results 1 to 2 of 2

Thread: .htaccess advice needed

  1. #1
    Join Date
    Jul 2010
    Posts
    5

    Question .htaccess advice needed

    Hi all

    I want to create some htaccess files for redirect, errors etc. but I'm not sure if I would have to create a seperate file for each task, or if I can include the code for each task all in one file e.g if I want a redirect for my site, plus custom redirect for 404's etc, plus say IP bans, can these all go in one file or do I do separate ones? And where do they need to go - in the root file of my site?

    I'm pretty new to this so any help would be much appreciated.

  2. #2
    Join Date
    Jul 2010
    Posts
    12
    You place .htaccess files in your server's assigned document root (i.e. the place where you would put your website's "index" page). If you don't want the rules of the .htaccess file to apply to your entire site, then you can place them in sub-directories (e.g. rules applying to the blog/ directory -> place the .htaccess file in the blog/ directory etc. (very simple example) )

    Your directories should only contain one .htaccess file - and you can add as many directives, rules and conditions as you want to a single .htaccess file - you can, however, have other .htaccess files in other directories.
    Learn PHP: nodehead.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles