<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; htaccess</title> <atom:link href="http://www.ghacks.net/tag/htaccess/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Speed Up WordPress With Better Permalink Rewrite Code</title><link>http://www.ghacks.net/2010/01/09/speed-up-wordpress-with-better-permalink-rewrite-code/</link> <comments>http://www.ghacks.net/2010/01/09/speed-up-wordpress-with-better-permalink-rewrite-code/#comments</comments> <pubDate>Sat, 09 Jan 2010 10:17:46 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[permalinks]]></category> <category><![CDATA[website]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[wordpress blog]]></category> <category><![CDATA[wordpress tweak]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=22159</guid> <description><![CDATA[A new WordPress blog uses an unoptimized url structure that uses numbers instead of the actual article titles. The so called permalinks need to be changed to switch from the number system to a system that is better readable for visitors and favored by the search engines. It is for instance possible to use urls [...]]]></description> <content:encoded><![CDATA[<p>A new WordPress blog uses an unoptimized url structure that uses numbers instead of the actual article titles. The so called permalinks need to be changed to switch from the number system to a system that is better readable for visitors and favored by the search engines. It is for instance possible to use urls that display the category and page title as the url, to mix in dates, numerics or custom information.</p><p>The most important rule for search engine optimization is to use the page title in the url. Everything else is optional and up to the user&#8217;s liking.</p><p><span
id="more-22159"></span>WordPress generates an .htaccess file when the permalinks are changed that contains the rewrite directives. It sometimes happens that the file cannot be created or written which would then mean that the user would need to create and edit the htaccess file manually.</p><p>The WordPress code that is used is not optimized. It does not prevent for instance unnecessary file and directory checks. JP Morgan over at the Webmaster World forum created a better rewrite directive that &#8220;fixes several performance-affecting problems&#8221;.</p><blockquote><p>This is a total replacement for the code supplied with WP as bounded by the &#8220;Begin WP&#8221; and &#8220;End WP&#8221; comments, and fixes several performance-affecting problems. Notably, the unnecessary and potentially-problematic <IfModule> container is completely removed, and code is added and re-structured to both prevent completely-unnecessary file- and directory- exists checks and to reduce the number of necessary -exists checks to one-half the original count (due to the way mod_rewrite behaves recursively in .htaccess context).</p></blockquote><p>According to JP the modified code speeds up the .htaccess code by at least a factor of two by &#8220;avoiding the second-pass exists checks on index.php itself, and avoiding exists-checks on resources such as image files which obviously don&#8217;t need to be handled by WP.&#8221;</p><p>Replace the old WordPress rewrite code in the .htaccess file with the following new code. You might need to edit the file types (gif|jpg|php|ico|css|js). These should contain the files that are requested the most. It might make sense to include png for instance in the list.</p><p><code># BEGIN WordPress<br
/> #<br
/> RewriteEngine on<br
/> #<br
/> # Unless you have set a different RewriteBase preceding this point,<br
/> # you may delete or comment-out the following RewriteBase directive<br
/> # RewriteBase /<br
/> #<br
/> # if this request is for "/" or has already been rewritten to WP<br
/> RewriteCond $1 ^(index\.php)?$ [OR]<br
/> # or if request is for image, css, or js file<br
/> RewriteCond $1 \.(gif|jpg|php|ico|css|js)$ [NC,OR]<br
/> # or if URL resolves to existing file<br
/> RewriteCond %{REQUEST_FILENAME} -f [OR]<br
/> # or if URL resolves to existing directory<br
/> RewriteCond %{REQUEST_FILENAME} -d<br
/> # then skip the rewrite to WP<br
/> RewriteRule ^(.*)$ - [S=1]<br
/> # else rewrite the request to WP<br
/> RewriteRule . /index.php [L]<br
/> #<br
/> # END wordpress </code></p><p>This change seems to speed up the WordPress loading time considerably. Let us know how you think it affected the page loading time if you have implemented it in your blog or noticed a difference here at Ghacks.</p><p>Visit the <a
href="http://www.webmasterworld.com/apache/4053973.htm">thread</a> over at the Webmaster World forum for additional information.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/01/09/speed-up-wordpress-with-better-permalink-rewrite-code/feed/</wfw:commentRss> <slash:comments>30</slash:comments> </item> <item><title>Secure your server with htaccess</title><link>http://www.ghacks.net/2008/03/31/secure-your-server-with-htaccess/</link> <comments>http://www.ghacks.net/2008/03/31/secure-your-server-with-htaccess/#comments</comments> <pubDate>Mon, 31 Mar 2008 17:08:47 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[The Web]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[basic auth]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[htpasswd]]></category> <category><![CDATA[password protection]]></category> <category><![CDATA[website]]></category> <category><![CDATA[website security]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=3672</guid> <description><![CDATA[I apologize if this topic drifts a bit away from the usual ones you find here at ghacks but I thought it would be extremely useful for everyone who has a server or webspace that supports htaccess and htpasswd. Htaccess files can do much more than just secure a directory on your server or website but I want to concentrate on this topic because it is something that I have been using on some of my websites for a very long time to increase security.]]></description> <content:encoded><![CDATA[<p>I apologize if this topic drifts a bit away from the usual ones you find here at ghacks but I thought it would be extremely useful for everyone who has a server or webspace that supports htaccess and htpasswd. Htaccess files can do much more than just secure a directory on your server or website but I want to concentrate on this topic because it is something that I have been using on some of my websites for a very long time to increase security.</p><p>I use it mainly to secure certain directories on my websites from being accessed without the proper authorization. This is the admin directory in the case of WordPress for instance but could also be used to secure a directory that hosts some valuable files.</p><p>I would like to point out two possibilities that secure a directory with .htacess. The first is to protect the directory by only allowing users with a certain IP or IP range access to it. Everyone else would receive an access denied error message.</p><p><span
id="more-3672"></span>The second possibility would be to create usernames and passwords that have to be supplied before accessing the content.</p><p><strong>IP Protection:</strong></p><p>Create a .htaccess file and add the following code to it:</p><p><code>AuthName "Protected Content"<br
/> AuthType Basic<br
/> <Limit
GET POST><br
/> order deny,allow<br
/> deny from all<br
/> #Comment<br
/> allow from 255.255.255.255<br
/> </Limit></code></p><p>Change the IP address in the last line to the one used by the user / users. You can use wildcards * if the user is receiving dynamic IPs from his ISP. It is possible to add as many allow from lines to the .htaccess file as you want. Place that htaccess file in the directory that you want to protect. (all subdirectories are affected as well.</p><p>The problem with this kind of protection is twofold. If your IP changes, say you are on holiday or accessing from a different location, you need to add or change the IPs in the htaccess code. Users who happen to have a IP of that range can access the content without problems. This is usually a user from the same ISP.</p><p>A more secure protection is the basic auth protection.</p><p><strong>Password Protection:</strong></p><p>Whenever a user tries to access a directory or file a popup will appear asking the user for a username and password. This method requires two files, a htaccess file and a htpasswd file. The htpasswd file stores the usernames and encrypted passwords and should be placed outside of the root directory of the website.</p><p><code>AuthName "Restricted Area"<br
/> AuthType Basic<br
/> AuthUserFile /path/to/.htpasswd<br
/> AuthGroupFile /dev/null<br
/> require valid-user</code></p><p>Since the passwords are encrypted you need to use a script to do that. A working one is the <a
href="http://www.htaccesstools.com/htpasswd-generator/">htpasswd</a> Content Generator. Just enter a username and password and click on encrypt. Paste the line on the results page into the htpasswd file and place it exactly in the path that you specified in AuthUserFile.</p><p>It is possible to combine both protections for added security. I would begin by evaluating if your webhost is allowing those kind of files.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2008/03/31/secure-your-server-with-htaccess/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
