Wednesday 24 July 2013

Creating ht access files

You and WordPress work together in glorious harmony to create the
.htaccess file that lets you use a pretty permalink structure in your blog. Follow these steps to create an .htaccess file on your Web server and create a new permalink structure:
1. Using a plain-text editor (such as Notepad for Windows or TextEdit for
a Mac), create a blank file; name it htaccess.txt and upload it to
your Web server via FTP. (See Book II, Chapter 2 for more information
about FTP.)
2. After the file is uploaded to your Web server, rename the file
.htaccess (notice the period at the beginning), and make sure that it is writable by the server by changing permissions to either 755 or 777. (See Book II, Chapter 2 for information on changing permissions on server files.)
If .htaccess already exists, you can find it in the root of your directory on your Web server — that is, the same directory where you find your wp-config.php file. If you don’t see it in the root directory, try changing the options of your FTP client to show hidden files. (Because the .htaccess file starts with a period [.], it may not be visible until you configure your FTP client to show hidden files.)
3. Create the permalink structure in the Customize Permalink Structure Book III
page in your WordPress Dashboard. Chapter 3
4. Click the Save Changes button at the bottom of the Customize
Permalink Structure page.
WordPress inserts into the .htaccess file the specific rules necessary for making the permalink structure functional in your blog.
If you follow the preceding steps correctly, you have an .htaccess file on
your Web server that has the correct permissions set so that WordPress
can write the correct rules to it. Your pretty permalink structure works
flawlessly. Kudos!
If you open the .htaccess file and look at it now, you see that it’s no longer blank. It should have a set of code in it called rewrite rules, which looks
something like this:

# BEGIN WordPress
<IfModule mod_rewrite.c> RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

0 comments:

Post a Comment