Does wordpress come with htaccess [closed]
开发者_Python百科
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questiondoes 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>
精彩评论