The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to update all htaccess on the server?

Discussion in 'General Discussion' started by netlook, Dec 26, 2004.

  1. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    Does anybody have a script which would update (add some text) to all my .htaccess files on the server? I will be very happy if you would share with it :)
     
  2. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    Code:
    #!/bin/sh
    /usr/bin/find /home -type f -name .htaccess >> htaccessfiles
    for files in `/bin/cat htaccessfiles`
    do
    echo "Your_text_here" >> $files
    done
    Would be one way .. use at your own risk :)
     
  3. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    Thank you.

    I made my own script in PERL, which done the update correctly, so I didn't check yours ;) If someone would have simillar problem, just write PM to me and I will send you that script.

    Bye
     
  4. s_2_s

    s_2_s Well-Known Member

    Joined:
    Aug 9, 2004
    Messages:
    215
    Likes Received:
    0
    Trophy Points:
    16
    would you please paste the perl code you made over here ?
     
Loading...

Share This Page