紫雨的能量运动

Law of Attraction ~ One Law And Rules Them All !

Editing Rewrite Rules (.htaccess) 四月 21, 2006

Filed under: Wordpress & Blog — PurpleRain @ 12:45 上午

Editing Rewrite Rules (.htaccess)

This is not required when using WordPress v1.5 or v2.0. These create and/or edit the .htaccess file for you.

Your server must have mod_rewrite for cruft-free permalinks to work. In addition, you must create a .htaccess file and place it in the directory in which your main index.php file resides. For example, if your WordPress blog is installed at domain.com/wordpress/, put the .htaccess file at domain.com/wordpress/.htaccess. However, if your WordPress installation is in a subdirectory, but your visitors access your site at the top level of your domain, place the .htaccess file at domain.com/.htaccess.

When you create a permalink structure, WordPress will generate rewrite rules for you to copy and paste into your .htaccess file.

A few cautions about creating and editing your .htaccess file:

  • You must have FTP access to create the .htaccess file
  • You must chmod the .htaccess file to 666 to edit it with the WordPress template editor. Do not leave your file’s permissions set to 666 as it may be accessible by anyone. After applying the permalinks, change the permissions to something stronger, like 660, to protect it.
  • If you leave whitespace at the end of your .htaccess file, it may make all pages on your site unavailable (though they will still exist, and your data will not be harmed). If this happens, delete the .htaccess file and create a new one.
  • If your .htaccess file contains errors that bring down your site, you will need to use FTP or your host’s control panel to delete the rogue .htaccess file. Once a fatal change has been saved in the WordPress editor, the editor (along with the rest of your site) will not be available until the problem is fixed.
  • You may also be able to use your host’s control panel to create and edit the .htaccess file. If so, it is likely you will still be able to edit the .htaccess file through this method, even if errors in the file have brought down your site itself.

Technorati :

 

发表评论

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s