SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: .htaccess?

  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess?

    HI,

    I want to mess around with some settings on my server and as im on a shared host i need to create a .htaccess file.

    I want to allow users to upload files bigger than the 2m default....ive found this resource at php.net which lists all the php.ini directives and ive tried to locate all the ones i think will need changing to enable me to do this.

    I have a few questions as ive never done this before. Firstly how do i put the .htaccess file together, do i simply list the directives i need and then save the file as .htaccess? Secondly, is anyone aware of any other directives i need to put in there to enable bigger file uploads ( im sure theres one relating to timeout of the script or browser or something but i cant find it.) and lastly where do i put the file....in the root or outside?

    thanks for any suggestions

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    See the comments at the bottom of the page you linked for what to put in the .htaccess file to change these settings (if overriding is allowed by your host). Put the file in your web root (or the specific directory the script you want these settings to apply to resides in).

  3. #3
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as putting the .htaccess file together, I just use notepad, write the directives line by line, and save as type > all files, filename as .htaccess

    If you make a mistake you'll usually find out in no uncertain terms with a big fat "internal server error" that will effect basically all pages.
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi guys thanks for the replies...so i had a look at the comments at the bottom of the page i linked ot and this bit confused me a bit:

    In .htaccess, only true/false on/off flags can be set using php_flag. To set other values you need to use php_value, like this:

    php_value upload_max_filesize 20M
    All ive dont so far is this:

    upload_max_filesize 8m
    max_input_time 1200
    post_max_size 8m

    could that possibly be correct?!

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You quoted where it says to write "php_value" before each setting, but you didn't write it in yours...

  6. #6
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Dan, Sorry to be dense here but so is it basically this:

    php_value upload_max_filesize 8m
    php_value max_input_time 1200
    php_value post_max_size 8m

    ?

  7. #7
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it looks right, does it work?
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development

  8. #8
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Sorry kinda got occupied with something else.....i dont know where exactly to put this file....do i need to literally put it in the directory where all my php files are???

  9. #9
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    yup.
    you can also have an .htaccess file in sub folders for things like mod_rewrite etc

    Off Topic:


    woo congrats on the 1000 posts
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  10. #10
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks spikez....thats great

    Haha i didnt even notice id got to a thousand today! Woo-hoo!


Bookmarks

Posting Permissions

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