#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,672
    Rep Power
    171

    Overwrote htaccess now the links dont work


    Hi;

    I accidentally overwrote htaccess now the friendly urls dont work anymore in this website.

    Can anyone please help me with an htacces file so i get my links back without changing html links?

    Thank you.
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,126
    Rep Power
    9398
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    Seriously, restore from your backups. If you don't have backups or a dev server, get them both
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,126
    Rep Power
    9398
    Check with your hosting company, they might have backups for you automatically.

    Otherwise I hope we've learned our lesson, right? Get a dev server at home, set up some source control, make backups...



    What rewriting are you missing?
  8. #5
  9. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,672
    Rep Power
    171
    No back up. I guess I have to edit the links.
    I need to make the dev sub domain and make changes there I understand.
  10. #6
  11. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,672
    Rep Power
    171
    Originally Posted by requinix
    What rewriting are you missing?
    It was only a few lines. I am pretty sure you wrote the mod rewrites for me back in October.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    186
    Rep Power
    84
    Originally Posted by zxcvbnm
    I need to make the dev sub domain and make changes there I understand.
    Set up a webserver/php/mysql on your home machine. Develop on that.
    When you've got your website how you want it, upload it to your live site.
    And, make backups of your live site often, just in case.
    It's not unknown for webhosting to disappear. a webhosting company in Melbourne (Distribute.IT)was hacked (un-recoverably) a few years ago, taking 4800 websites, including the webhosting business, with it.
  14. #8
  15. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4123
    cloud servers = cheap way to have multiple servers (eg identical set ups for dev, stage and live)

    Automated back ups = > allows you to restore. I have daily backups running

    Offsite backups => in case your office or data centre burns down

    source control => allows roll backs of code bases.

    I'm still trying to figure out GIT, but until I do I'm still using SVN. I have an SVN server which manages the code base in SVN. I then have a dev server on which I actively develop and commit to SVN. I have a stage server which is identical to my dev server, but i don't work on it. This is where I check out a commit to test it in a simulated "live" environment. Then I have a live server on which I check out stable versions of the code. As GIT is distributed it means that any machine using the repository holds a complete version, so it doesn't matter if one of them goes down.

    EDIT:

    A senior developer would know all this, be expected to know this (maybe even set this up) and ensure he and his team work within the policies
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,998
    Rep Power
    375
    in my last place, they had this thing set up, whereby everything you saved was "saved" in svn repository and wasnt made live until you "committed" the code.

    I would like to have that system running here but I have no idea on how to go about it? any pointers would be nice? This is just so that when (and i am sure i will, even though i have backups) I make a silly mistake, i can go back.
  18. #10
  19. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Originally Posted by paulh1983
    I would like to have that system running here but I have no idea on how to go about it?
    TortoiseSVN

    It's a nice GUI with a shell extension. You can simple create a local repository and commit into it (right click -> TortoiseSVN -> Create repository here, that's it).
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  20. #11
  21. No Profile Picture
    Dazed&Confused
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Tempe, AZ
    Posts
    506
    Rep Power
    128
    Originally Posted by requinix
    WHY WERE YOU DEVELOPING ON YOUR LIVE SERVER?
    Well, a live server and not a development copy of the site.

    I'll often have dev.domain.com alongside the production domain.com, just strapped down by Apache to either require a Basic Auth login or IP restriction.

    Ideally I'd have separate development and production servers altogether, and I usually can get that for my professional work, but hobbyist programming makes that tougher to maintain.

    I'm not sure about XAMPP but having used WAMP Server for desktop-based PHP development, it's just impossible to duplicate the server environment perfectly. If it's possible to run PHP as CLI in it, I haven't found it, which really hurts the ability to do quick test scripts. Some modules also seem to be missing, like pthreads.
    LinkedIn: Dave Mittner
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2006
    Posts
    40
    Rep Power
    9
    Try this
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

IMN logo majestic logo threadwatch logo seochat tools logo