开发者

Does wordpress come with htaccess [closed]

Closed. This question is off-topic. It is not currently accepting answers.
开发者_Python百科

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

does wordpress come with a htaccess file? I have my file zilla showing all files but I can't seem to find it.


No, a freshly installed WordPress won't have a .htaccess set up yet.

Also, some servers have them set as hidden, so you won't be able to view them via plain FTP. I use this script I made to check if there's a .htaccess and if there is, to display its contents. Save it as ht.php and upload it then browse to it to see.

<pre>
<?php
$filename = ".htaccess";

if (file_exists($filename))
{
    $handle   = @fopen($filename, "rb");
    $contents = fread($handle, filesize($filename));
    $data     = explode("\n", $contents);
    fclose($handle);

    for ($i = 0; $i < count($data); $i++) 
    {
        echo htmlspecialchars($data[$i], ENT_QUOTES) . "\n";
    }
}
else
{
    echo '<b>Error:</b> No such file found';
}
?>
</pre>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜