1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

XP wont let me create .htaccess

Discussion in 'Windows XP' started by jrfoleyjr, 2006/01/22.

  1. 2006/01/22
    jrfoleyjr

    jrfoleyjr Inactive Thread Starter

    Joined:
    2006/01/22
    Messages:
    4
    Likes Received:
    0
    I did a search on .htaccess, cant edit or create .htaccess, and it came back empty...

    I am running Apache server on my XP machine with SP2 and all current patches. I attempted to create the .htaccess file for apache and Windows gives an error. I tried it in notepad and wordpad. It insists on saving it as ".htaccess.txt ". (minus the quotes) When I try to remove the .txt it gives the error "You Must Type a File Name" and it reverts back to .htaccess.txt.

    Do I have a wrong setting somewhere in Windows? Or do I have to make a registry change somewhere to fix this?
    Thanks in advance
     
  2. 2006/01/22
    PeteC

    PeteC SuperGeek Staff

    Joined:
    2002/05/10
    Messages:
    28,890
    Likes Received:
    387

  3. to hide this advert.

  4. 2006/01/22
    jrfoleyjr

    jrfoleyjr Inactive Thread Starter

    Joined:
    2006/01/22
    Messages:
    4
    Likes Received:
    0
    ...uhhh this is a WINDOWS trouble not an APACHE trouble...
    WINDOWS will not let me name the file as .htaccess without appending a .txt onto the end of it! And Yes I have been reading tutorials for Apache for some time. I have run an apache server for 2 years now and am just now finding a use for the .htaccess file. I found that WinXP Pro SP2 will not let me make it! Apache has nothing to do with file naming attributes under windows. Doing the "Right Click, Rename" to remove the .TXT is NOT working. WinXP Pro is giving an error and then it reverts the file back to .HTACCESS.TXT No I did not just get a computer yesterday. Even though I list my experience as intermediate, because I do NOT have a MCSE or A+, I do computer repairs as a sideline. I have been in electronics for over 40 years, have a ham radio license for 33 years, and have been in computing as a hobby for 23 years. These obscure WINDOWS troubles are something that I do not know what to do to fix. After searching the FAQs and elsewhere I posted the question here! I just went back and reread my first post on this and I thought I said it clearly enough there! Time to beat the dead horse some more...
    :)
    Thanks!
     
    Last edited: 2006/01/22
  5. 2006/01/22
    skeet6961

    skeet6961 Inactive

    Joined:
    2005/09/03
    Messages:
    522
    Likes Received:
    0
    what account are logged on as during the error? - admin/non-admin

    where is apache installed and where are u attemping to write the file?

    is apache running when u do this?

    logon as admin or equiv

    stop apache

    write the file and check any perms that apache requires on this file/folder
     
  6. 2006/01/23
    rsinfo

    rsinfo SuperGeek Alumni

    Joined:
    2005/12/25
    Messages:
    4,038
    Likes Received:
    174
    It seems SP2 does NOT allow any file to start with '.' and also not have an extension. Security feature ?:confused:
     
  7. 2006/01/23
    SpywareDr

    SpywareDr SuperGeek WindowsBBS Team Member

    Joined:
    2005/12/31
    Messages:
    3,752
    Likes Received:
    338
    Try this:
    1. Create your new file in Notepad.

    2. Click File | Save As....

    3. In the Filename box, type in:
      .htaccess​

    4. In the Save as type: pulldown, select All files.

    5. Click the Save button.
     
  8. 2006/01/23
    PeteC

    PeteC SuperGeek Staff

    Joined:
    2002/05/10
    Messages:
    28,890
    Likes Received:
    387
    jrfoleyjr

    FWIW, despite your unwarranted outburst - we are only trying to help here and I guess there are not many Apaches around on the Board :D ....

    I did as SpywareDr suggested - saved a gobblygook file in Notepad as .hcaccess with Save as Type - All Files selected.

    It saved as .hcacess.txt - I simply renamed it to .hcaccess which was accepted.

    The only basic setting I have disabled in Folder Options > View is Use Simple File Sharing.
     
  9. 2006/01/23
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,068
    Likes Received:
    396
    I make .htaccess and .htpasswd files all the time using notepad. If I use Save As - All Files and name it .htaccess it does not put the .txt extension on the file.

    You may have "messed things up" if you opened an .htaccess one time and windows prompted you to choose a program to open it with. And you chose Notepad and there was a check in the box to "always use this program to open files of this type ". Then Notepad became associated with the .htaccess extension.

    The .htaccess and .htpasswd files should have NO program associated with it, e.g. it will use the default generic windows icon.
     
  10. 2006/01/23
    SpywareDr

    SpywareDr SuperGeek WindowsBBS Team Member

    Joined:
    2005/12/31
    Messages:
    3,752
    Likes Received:
    338
    Hmmm... worked on both XP Home and XP Pro on this end. You might try enclosing the filename between double quotes, i.e., ".htaccess" (or "c:\wherever\.htaccess ").
     
  11. 2006/01/23
    PeteC

    PeteC SuperGeek Staff

    Joined:
    2002/05/10
    Messages:
    28,890
    Likes Received:
    387
    That worked - saved directly as .hcaccess as an HCACCESS file type :)
     
  12. 2006/01/23
    jrfoleyjr

    jrfoleyjr Inactive Thread Starter

    Joined:
    2006/01/22
    Messages:
    4
    Likes Received:
    0
    Thanks Tony...

    TonyT, Of all the suggestions, you pointed me in the right direction. I have re-saved the .htaccess.txt file as simply .htaccess with no program association. I needed this to be able to do some page redirection for a page that no longer exists.

    PeteC, thank you for your attempt. I felt that I was being trolled and reacted. :( I thought that when I asked a Windows XP question in the WinXP area, it would be treated as a WinXP (not Apache) question. My error! :( I should not have mentioned that it was for use with Apache Server as this introduced an X factor in some minds. Sorry. :(

    Thanks to all who attempted to answer this... and the prize to TonyT! :)
     
  13. 2006/01/24
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,068
    Likes Received:
    396
    You should not need to use .htaccess for redirects with apache.
    Apache is configured using httpd.conf file which contains the apache directives. And they should be similar. Redirects can be done via the conf. Here's example from httpd.conf file:

    Code:
    #
    # Redirect allows you to tell clients about documents which used to exist in
    # your server's namespace, but do not anymore. This allows you to tell the
    # clients where to look for the relocated document.
    # Format: Redirect old-URI new-URL
    #
    
    #
    Therefore, one just needs to add the line(s) like this:
    Code:
    #
    # Redirect allows you to tell clients about documents which used to exist in
    # your server's namespace, but do not anymore. This allows you to tell the
    # clients where to look for the relocated document.
    # Format: Redirect old-URI new-URL
    #
    Redirect pageA.html  pageB.html
    Redirect page22.html  page44.html
    Redirect /software/tools/cleandisk.zip  http://123.com/cleandisk.zip
    #
     
    Last edited: 2006/01/24
  14. 2006/01/24
    jrfoleyjr

    jrfoleyjr Inactive Thread Starter

    Joined:
    2006/01/22
    Messages:
    4
    Likes Received:
    0
    TonyT, My only reason for using .htaccess was to avoid making changes in the config file. I figured an easily changed external file that did not require apache to be shut down each time it was modified would be the place to make the change. Then I ran into this problem with creating .htaccess and here we are!
    Thank you again for your help... and we ought to move it elsewhere if we carry on with an Apache thread. :D We are probably boring the heck out of the non-Apache server types on here anyway! ;)



     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.