drvc63490 2015-05-28 16:41
浏览 96
已采纳

为什么.htaccess会自动更改为.htaccess.txt

I am trying to use mod_rewrite and appache to convert my dynamic URLs in to static ones. Therefore I created a .htaccess file in my root folder that is c:xampp/htdocs/unnamed. However whenever i try to rename my text document to .htaccess it automatically changes to .htaccess.txt. It appears only .htaccess in the folder but when i look in the details in the properties menue it is actually .htaccess.txt. Does anyone know how do i change it to just .htaccess
Screenshot of Properties window

  • 写回答

2条回答 默认 最新

  • dreamwind1985 2015-05-28 16:46
    关注

    That is because on windows it thinks .htaccess is the name of the file. It considers it to be text. Linux it works differently. It doesn't depend on extensions in Linux.

    In order for it to work you just rename the file and remove .txt from it. Then it should work how you like it.

    1. Open the file your created in a text editor, just use Notepad.
    2. Choose "Save as.." and select "All types (.)" next to file type.
    3. Then type .htaccess and click on save.

    FYI: I would also turn on showing file extensions if you don't already have that on so you can see what extensions your files have by looking at them in the folder.

    http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-7

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?