Results 1 to 9 of 9
  1. #1

    I can vi .htaccess but dir doesn't show it and I don't think it works

    Centos 6.4
    Apache 2.2
    VPS full root access

    I created the .htaccess file in an effort to get WordPress to run correctly.

    But I can't see it with "dir" or "ls -a" in the command line. "locate .htaccess" comes up empty.

    "vi .htaccess" brings up the file the way I wrote it.

    And it doesn't seem like it had the desired effect ... new pages still come up 404 not found.

    What don't I understand, would you say?

  2. #2
    Join Date
    Oct 2002
    State of Disbelief
    Try "ls -la".
    Having problems, or maybe questions about WHT? Head over to the help desk!

  3. #3
    Join Date
    May 2013
    ls -a should display the file. Are you sure you're using vi correctly? For a new user, it can be a bit tricky to use. You must remember to write the file before exiting.
    ▄▀▄ Brian Harrison, Lead Engineer - Reprise Hosting (AS62838)
    ▄▀▄ Deals on cheap dedicated server hosting. IPMI included! Unmetered bandwidth.
    ▄▀▄ Website migration, 24/7/365 support, basic server setup, 15 day money back.
    ▄▀▄ Looking for DEALS on self-managed cheap VPS hosting? Visit

  4. #4
    Quote Originally Posted by bear View Post
    Try "ls -la".
    There it is!

    ... still have to figure out why it doesn't work though. I wonder if it's a permissions issue.

  5. #5
    Join Date
    Feb 2005
    Ownership and permissions will be shown by ls -la. Another thing to check: are you sure your current working directory is the right place to put the .htaccess file? Perhaps try:
    vi /home/username/public_html/.htaccess
    (change path as appropriate)

    "locate" usually requires an "updatedb" as root to pick up recent changes.

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  6. #6
    Also make sure that mod_rewrite in enabled in Apache configuration.
    || Web Hosting Blog - Web Hosting security & latest web hosting industry Announcements
    || Web Hosting Discussion - A Web Hosting community

  7. #7
    Join Date
    Feb 2012
    Make sure you write the contents to the .htaccess files well enough.

    Use a normal text editor on your local machine and upload it through ftp if you are not comfortable with the vi editor.

    Also, make sure the owner and group are set to "username" and not "root".
    WEBUZO - Single User Control Panel for your VPS/Cloud/Server (CentOS/Ubuntu)
    Install NGINX, Apache, MySQL, LAMP, LEMP, PHP, Java and 310+ popular scripts by a CLICK
    Email Server, Database Management, Domain Management, FTP Management, CSF, CRON

  8. #8
    You can always use nano or pico editor if your not skilled in vi, might be easier then the ftp option

  9. #9
    Try to install nano via :

    PHP Code:
    yum install nano 
    then try
    nano /URL/.htaccess

    Hope this will work for you

Similar Threads

  1. My DNS works, then it doesn't work, then it works, etc...
    By EverSpeed in forum Hosting Security and Technology
    Replies: 9
    Last Post: 09-10-2005, 07:23 PM
  2. .htaccess dir. manipulation
    By Triloxigen in forum Programming Discussion
    Replies: 0
    Last Post: 04-14-2005, 04:40 AM
  3. My DSL works fine, but sometimes webpages don't show up..
    By FadeOne1 in forum Web Hosting Lounge
    Replies: 10
    Last Post: 09-10-2004, 05:09 AM
  4. Replies: 7
    Last Post: 10-03-2002, 07:57 AM
  5. htaccess problem, want to make a secure dir
    By Adriaan in forum Dedicated Server
    Replies: 2
    Last Post: 03-14-2002, 06:32 AM

Posting Permissions

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