|
Search:
Advanced search
|
Browse by category:
|
Glossary |
.htaccess file - What is it used for, how to set php memory, how to setup dynamic urls, how to setup redirects |
||||
What they are/How to use them
Technical Definition .htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof. Simple Definition It's a file that allows you to make changes to the way php/apache behaves and to it's resources. Things you can do: (by placeing these lines within the .htaccess file) one per line. Alter / increase the memory allocation for php: php_value memory_limit 20M Redircect one page or directory to another Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html You can also place codes after the word Redirect which will tell search engines and browser how they are to handle the redirect: Redirect 301 - moved permanently * 301 - Moved Permanently * 302 - Moved Temporarily * 403 - Forbidden * 404 - Not Found * 410 - Gone # seo friendly redirect for a single file Redirect 301 /old-dir/old-file.html http://domain.com/new-dir/new-file.html # seo friendly redirect for multiple files # redirects all files in dir directory with first letters xyz RedirectMatch 301 /dir/xyz(.*) http://domain.com/$1 # seo friendly redirect entire site to a different domain Redirect 301 / http://different-domain.com Setting MIME types in .htaccess Add the following line format: addtype mimeType fileExtension Examples: addtype text/vnd.wap.wml wml addtype application/vnd.wap.wmlc wmlc addtype image/vnd.wap.wbmp wbmp addtype text/vnd.wap.wmlscript wmls addtype application/vnd.wap.wmlscriptc wmlsc addtype application/vnd.wap.xhtml+xml xhtml |
||||
Powered by
KnowledgebasePublisher (Knowledgebase software)

