<?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"
	>

<channel>
	<title>Henrie Media Inc &#187; Technical Support</title>
	<atom:link href="http://www.henriemedia.com/view/technical-support/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://www.henriemedia.com</link>
	<description>Henrie Media Inc. specializes in providing innovative marketing solutions and services to our customers.</description>
	<pubDate>Mon, 03 Nov 2008 21:05:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Is Your Website Search Engine Friendly?</title>
		<link>http://www.henriemedia.com/website-strategies/is-your-website-search-engine-friendly/</link>
		<comments>http://www.henriemedia.com/website-strategies/is-your-website-search-engine-friendly/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 08:00:27 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Technical Support]]></category>

		<category><![CDATA[Website Strategies]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=98</guid>
		<description><![CDATA[Ross Dunn, CEO of StepForth Search Engine Placement Inc., recently wrote a great article on strategies to make your website more search engine friendly. Here is the meat of that article -
When I sit down with new clients and discuss the status of their new or existing site they are often shocked when I am [...]]]></description>
			<content:encoded><![CDATA[<p>Ross Dunn, CEO of StepForth Search Engine Placement Inc., recently wrote a great article on strategies to make your website more search engine friendly. Here is the meat of that article -</p>
<p>When I sit down with new clients and discuss the status of their new or existing site they are often shocked when I am forced to inform them that their site is not search engine friendly. Encountered with a blank but slightly shaken look I then explain that this means their site has a particular problem that is hindering search engine rankings. Often this is represented by an inflexible design, overuse of advanced web technologies, or simply a weak navigation scheme. As a result, if they were to continue with the site as it stands they are unlikely to attain competitive search engine rankings.</p>
<p>The following is checklist designed to help you gauge the search engine friendliness of your website and, if you are in the midst of planning a website this checklist will help you avoid the common pitfalls of unfriendly designs.</p>
<h2>Technologies</h2>
<p>First consider what technologies your website is using. There are certain technologies that require a little more hand holding than others to ensure search engine compatibility.</p>
<p><strong>1. FRAMES</strong><br />
Lets start with this oldie. Luckily, frames are becoming a way of the past what with the use of DIV layers and the slow onset of incredibly flexible AJAX coding. The long and the short of it is that if you have Frames on your website then you are starting off at a disadvantaged position that cannot be truly search engine friendly no matter what you do. There are, however, some remedial fixes that will tie you over until you can redesign your site; yes I said redesign. The fix that I recommend is to use a noframes tag whereby you place another version of your web page inside of your framed page. This ‘backup’ page is what the search engines will view; here you can place relevant content and navigational elements so that the search engines can at least navigate portions of your site that are (hopefully) not framed.</p>
<p>More info on the no frames tags.</p>
<p><strong>2. FLASH</strong><br />
There was a big brouhaha that Flash had become search engine indexable and you no longer had to worry about its search engine issues. Frankly, I have not seen the fruits of this ‘improvement’ to a respectable degree yet so I still consider it a kiss of death for websites designed solely in Flash. If you have a Flash-only website then I recommend one of these two options; one is to design an html version of your website and make the home page of your website html rather than Flash where you can then allow users to choose between html or Flash. The second option is to redesign the site so that it mixes both html and flash together. For example, this might mean implementing Flash amidst content on an HTML page as you would an image. I realize there are certain limitations to this option but if you can create a slick site in this manner then you will have the best of both worlds; clean search engine friendly content along with an interactive, multimedia feel. Just remember that the majority of relevant text should be in HTML format for the search engines to index.</p>
<p><strong>3. Search Engine ‘Unfriendly&#8217; Dynamic URL’s</strong><br />
Unfriendly dynamic URL’s are a common side effect of using a Content Management System that is not designed with search engine rankings kept in mind. Here are some examples of some unfriendly URL’s:</p>
<p><strong>Sample 1: </strong><br />
<span class="sampleCode">http://www.mydomain.com/myproducts.php&amp;354=prod333&amp;subproduct</span></p>
<p><strong>Sample 2:</strong><br />
<span class="sampleCode">http://www.surfboardsforyou.com/boards/<br />
filename.php?id=F98ZF4&amp;productId=39222&amp;section=wicked&amp;brand=582&amp;template=532</span></p>
<p>These URLs are problematic because a search engine may consider these addresses too complex to spider. Why too complex? Suffice it to say that the more complex the URL, the higher the chance that a search engine robot will consider the content too dynamic to read; it changes too often to be valuable to a search engine.</p>
<p>The way around these types of URLs is actually not so difficult; it may only require a small investment of time and money. The ‘time’ will be required when researching which URL fix is right for your system. The money may be required to pay a programmer to implement and test the new URLs. Here are how the URLs might look once they are fixed to be search engine friendly:</p>
<p><strong>Sample 1 Fixed:</strong><br />
<span class="sampleCode">http://www.mydomain.com/myproducts/354/prod333/subproduct/</span></p>
<p><strong>Sample 2 Fixed:</strong><br />
<span class="sampleCode">http://www.surfboardsforyou.com/boards/wickedboards/39222/board532/</span></p>
<p>These URLs are better because they do not include the extraneous characters that are so telltale on dynamic websites. In addition, the URLs are designed to appear like normal website directories when in fact they are dynamic URLs.</p>
<p>Important: it is vital that you minimize the length of the URLs that you use. Search engines may stop crawling a website if there appear to be too many subdirectories. The samples above show fixed URLs that have about as many subdirectories as I would allow (4).</p>
<h2>Design</h2>
<p>This section focuses on the overall layout and usability of your designs from the perspective of a search engine robot. Search engine friendly design is occasionally quite complex so I have provided a list of the most common issues to consider.</p>
<p><strong class="emphasisred">1. Menus</strong><br />
Are the menus on your website spiderable? If not you may be hiding major areas of your website from search engine spiders and missing out on additional search engine rankings.</p>
<p>The fact is there are very few menus out there that a search engine will have a problem following, but there are definitely some worth avoiding. For instance do not use a JavaScript Jump Menu as the core mode of navigation of your website; search engines cannot index this type of menu. Also be careful of Flash menus, they look slick but they will impede the progress of a search engine spider especially if they are the only means of navigation within your site.</p>
<p><strong>General Menu Rules</strong><br />
The ideal menu would be text based and each text link would include the keywords you are targeting on the destination page. Setting up a menu with this much forethought requires that you determine the layout and content for your site before web design begins. Once you have a clear picture of the content for each page you can then research the keywords that are best to target per webpage. This essential keyword research can be done in house easily enough using systems-like keyword research tools that provide you with a glimpse into how your customers think by showing how many searches there are per month (or year) for a particular term.</p>
<p>Remember, almost every page within your site has a very real opportunity to gain a top ranking; all you need to do is ensure that the design, content and site structure is optimized. Ensuring that the menu is carefully thought out and designed is a crucial step for top rankings.</p>
<p>Finally, if you are at all uncertain whether your menu is search engine friendly then be certain to back it up with a text menu in the footer of your page using the same keyword targeting principles noted above.</p>
<p><strong>Tech Advice:</strong> a simple text menu may be less than desirable for you; in this case I recommend DHTML menus. These menus use text but in a manner that is quite appealing and very search engine friendly.</p>
<p><strong>2. Sitemaps</strong><br />
Sitemaps can dramatically help the visibility of your website by allowing search engine spiders easy access to all of the pages in your site. Place a link to the sitemap on every page within your site to ensure easy access no matter where a search engine or user enters your site.</p>
<p><strong>Sitemap Tips</strong><br />
Just having a sitemap will help but how you build your sitemap will also play a role in how well the search engines catalogue it. For example, if you have a twenty-page website it would be ideal to create a sitemap where each page is represented by a title along with a short description. Ultimately, the page may be a bit long but it will have content that the search engines like to index and it will boost the relevance of the linked pages because the titles will accurately represent the content. So in effect, you will now have more than just a sitemap; you will have a table of contents for your site that has the potential of getting a ranking and provides an extra boost to the ranking worthiness of each page.</p>
<p><strong>Google Sitemap</strong><br />
Google Sitemap is an additional design element that you should consider adding.</p>
<p><strong class="emphasisred">3. Layout</strong><br />
How you layout your page can make a significant difference in how well your site ranks and ultimately how search engine friendly it is.</p>
<p><strong>Tips for Layout</strong><br />
Search engine robots read a webpage from the top of the source code (the programming that made your page – see “view source” in your browser) all the way to the bottom. As a result, it is important to ensure that both of the following elements are found as close to the beginning of code as possible:</p>
<p><strong>A) </strong>A short sentence introducing the topic using the keyword targets you have chosen for the page.<br />
<strong>B)</strong> Your text menu and other navigational aids, or if this is not possible it would be even more beneficial to start with a paragraph or two of relevant content followed by the navigation.</p>
<p>By placing this information near to the top of the page, you will promptly present the search engine robot with relevant text that backs up the page title and backlinks. You will also provide an immediate sitemap of sorts for the search engine to spider, which includes keywords relevant to each page.</p>
<p><strong>4. Splash Pages – ACK!</strong><br />
With the odd exception Splash Pages are a kiss of death for a website because the home page (the first page seen when someone visits your domain), your most important page, is often converted into nothing but an excess entry point with little or no relevant content on it. Aside from reducing your chances for ranking, you are also making your visitors take another step to get to content or sales material in your site. Any additional steps you add will lessen the likelihood of a successful sale.</p>
<p><strong>Please Let Me Change Your Mind</strong><br />
If you think you need to use a splash page then you need to talk to someone who will change your mind. No, honestly, give me a call if you want because there is nothing more painful to a SEO or search engine friendly web designer to see a Splash Page in use. If, in the unlikely scenario your splash page is required, there are ways to make it slightly more search engine friendly.</p>
<p>1) Add a highly relevant and well-worded paragraph to the page so that the search engines have something to index that shows them they are in the right place.<br />
2) Either provide a link to your sitemap or implement a text menu in the footer of the page so the search engines can access the internal workings of your website without having to take an extra step.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/website-strategies/is-your-website-search-engine-friendly/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Exclude Category from the main page or RSS feed in Wordpress</title>
		<link>http://www.henriemedia.com/technical-support/exclude-category-from-the-main-page-or-rss-feed-in-wordpress/</link>
		<comments>http://www.henriemedia.com/technical-support/exclude-category-from-the-main-page-or-rss-feed-in-wordpress/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 22:17:12 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Technical Support]]></category>

		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=72</guid>
		<description><![CDATA[Have you ever wanted to exclude a category from the main page or the RSS feed of your Wordpress blog? This is the easiest way I have found to do this, without installing a plug-in.
Put the following code anywhere in your theme&#8217;s template functions.php file. For example, if your theme is called &#8220;travel&#8221; then you [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to exclude a category from the main page or the RSS feed of your Wordpress blog? This is the easiest way I have found to do this, without installing a plug-in.</p>
<p>Put the following code anywhere in your theme&#8217;s template functions.php file. For example, if your theme is called &#8220;travel&#8221; then you would probably find this file here - wp-content/themes/travel/functions.php. If for some reason this file doe not exisit, just create it and save it in your theme&#8217;s folder.</p>
<p>Copy and paste the following into the functions.php file -</p>
<p>function exclude_category($query) {<br />
if ( $query-&gt;is_feed || $query-&gt;is_home ) {<br />
$query-&gt;set(&#8217;cat&#8217;, &#8216;-1&#8242;);<br />
}<br />
return $query;<br />
}<br />
add_filter(&#8217;pre_get_posts&#8217;, &#8216;exclude_category&#8217;);</p>
<p>The code above excludes the category with the id of &#8220;1&#8243; from both the RSS feed and from the main page of your blog. If you want to exclude multiple categories, simply add a comma ( , ) and a dash ( - ) followed by the category ID. For example: &#8216;-2, -3, -4&#8242;. You can locate the category id by logging into the Wordpress dashboard, clicking on manage, then categories.</p>
<p>If you just want to exclude a category from the main page and not the RSS feed, simply replace &#8220;( $query-&gt;is_feed || $query-&gt;is_home )&#8221; with &#8220;( $query-&gt;$query-&gt;is_home )&#8221; or to remove it from just the RSS feed &#8220;( $query-&gt;is_feed)&#8221;.</p>
<p>That&#8217;s all there is to it! Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/technical-support/exclude-category-from-the-main-page-or-rss-feed-in-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dynamic Meta Code for Wordpress</title>
		<link>http://www.henriemedia.com/technical-support/dynamic-meta-code-for-wordpress/</link>
		<comments>http://www.henriemedia.com/technical-support/dynamic-meta-code-for-wordpress/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 20:51:00 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Technical Support]]></category>

		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=64</guid>
		<description><![CDATA[So I have wanted to have dynamically generated META Code (title, description, keywords) for my Wordpress blog for sometime now. I tried all of the plug-ins and frankly, they just didn&#8217;t get me where I wanted to go.  I also didn&#8217;t want to do all the extra work of maintaining separate text for the [...]]]></description>
			<content:encoded><![CDATA[<p>So I have wanted to have dynamically generated META Code (title, description, keywords) for my Wordpress blog for sometime now. I tried all of the plug-ins and frankly, they just didn&#8217;t get me where I wanted to go.  I also didn&#8217;t want to do all the extra work of maintaining separate text for the META fields - I wanted them dynamically generated.</p>
<p>So I sat down and wrote the following code that I think you might find helpful to increase your blog&#8217;s SEO (Search Engine Optimization) value.</p>
<p>All of these changes should occur in your header.php file of your Wordpress blog&#8217;s template files.</p>
<p>First, I wanted to dynamically create the <strong>&lt;title&gt;</strong> tag with the blog&#8217;s name as the default, but include the category, archive or page title when I was browsing a category, archive or page. Here is the code to do that. Simply cut and paste this code, replacing your current &lt;title&gt;&lt;/title&gt; tag.</p>
<p>&lt;title&gt;&lt;?php if (is_home()): bloginfo(&#8217;name&#8217;); elseif (is_category()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); single_cat_title(); elseif (is_day() || is_month() || is_year()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_time(&#8217;F Y&#8217;); else: bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_title(); endif; ?&gt;&lt;/title&gt;</p>
<p>Next, i wanted to dynamically create the <strong>&lt;META description&gt;</strong> tag to make it unique to each page of my blog. Specifically I wanted it to display the current category or archive I was browsing or if I was browsing a page I wanted it to dynamically create the description from the first 20 words of my  post. Here is the code to do that. Simply cut and paste this code, replacing the current &lt;META description=&#8221;" /&gt; tag.</p>
<p>&lt;meta name=&#8221;description&#8221; content=&#8221;&lt;?php if (have_posts()&amp;&amp; is_single()):while(have_posts()):the_post(); the_excerpt_rss(20,2); endwhile; elseif (is_category()): single_cat_title(); print(&#8221; category of the &#8220;); bloginfo(&#8217;name&#8217;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F Y&#8217;); print(&#8221; archive of the &#8220;); bloginfo(&#8217;name&#8217;); else: bloginfo(&#8217;description&#8217;); endif; ?&gt;&#8221; /&gt;</p>
<p>NOTE: You can change the number of words contained in the page description by changing the first number of the_excerpt_rss() function. So in my example, I have it set to 20 words - the_excerpt_rss(20,2). If I wanted 25 words, I would change it to this - the_excerpt_rss(25,2).</p>
<p>Finally, the <strong>&lt;META keywords&gt;</strong>. I wanted to keep the keywords consistent from category to archive to page, only adding additional category names or archive attributes.  Here is the code to do that. Simply cut and paste this code, replacing the current &lt;META keywords=&#8221;" /&gt; tag.</p>
<p>&lt;meta name=&#8221;keywords&#8221; content=&#8221;&lt;?php if (is_category()): single_cat_title(); print(&#8221;, &#8220;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F'); print(&#8221;, &#8220;); the_time(&#8217;Y'); print(&#8221;, &#8220;); endif;?&gt;travel, blog, destination, information, see, do, help, advice, reviews, save, savings, ideas, business, golf&#8221; /&gt;</p>
<p>That&#8217;s all there is to it! To make it easier for you, here is all of the change in once place so you just copy and paste once! Happy SEO!</p>
<p>&lt;title&gt;&lt;?php if (is_home()): bloginfo(&#8217;name&#8217;); elseif (is_category()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); single_cat_title(); elseif (is_day() || is_month() || is_year()): bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_time(&#8217;F Y&#8217;); else: bloginfo(&#8217;name&#8217;); print(&#8221; - &#8220;); the_title(); endif; ?&gt;&lt;/title&gt;<br />
&lt;meta name=&#8221;description&#8221; content=&#8221;&lt;?php if (have_posts()&amp;&amp; is_single()):while(have_posts()):the_post(); the_excerpt_rss(20,2); endwhile; elseif (is_category()): single_cat_title(); print(&#8221; category of the &#8220;); bloginfo(&#8217;name&#8217;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F Y&#8217;); print(&#8221; archive of the &#8220;); bloginfo(&#8217;name&#8217;); else: bloginfo(&#8217;description&#8217;); endif; ?&gt;&#8221; /&gt;<br />
&lt;meta name=&#8221;keywords&#8221; content=&#8221;&lt;?php if (is_category()): single_cat_title(); print(&#8221;, &#8220;); elseif (is_day() || is_month() || is_year()): the_time(&#8217;F'); print(&#8221;, &#8220;); the_time(&#8217;Y'); print(&#8221;, &#8220;); endif;?&gt;travel, blog, destination, information, see, do, help, advice, reviews, save, savings, ideas, business, golf&#8221; /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/technical-support/dynamic-meta-code-for-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bookmark this page JavaScript</title>
		<link>http://www.henriemedia.com/website-strategies/seo-tools/link-analysis/bookmark-this-page-javascript/</link>
		<comments>http://www.henriemedia.com/website-strategies/seo-tools/link-analysis/bookmark-this-page-javascript/#comments</comments>
		<pubDate>Tue, 27 May 2008 12:00:35 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Code Library]]></category>

		<category><![CDATA[Link Analysis]]></category>

		<category><![CDATA[Technical Support]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=30</guid>
		<description><![CDATA[Here is a handy &#8220;Bookmark this page&#8221; JavaScript I wrote that will work in Internet Explorer, Firefox, Safari and most of the major web browser. The script will prompt the user to bookmark the page they are on. Here is what you need to use this script on your website.
Put the following code between the [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a handy &#8220;Bookmark this page&#8221; JavaScript I wrote that will work in Internet Explorer, Firefox, Safari and most of the major web browser. The script will prompt the user to bookmark the page they are on. Here is what you need to use this script on your website.</p>
<p>Put the following code between the &lt;head&gt;&lt;/head&gt; tags of your webpage -</p>
<p><em>&lt;script&gt;<br />
function bookmark(title,url){<br />
if(window.sidebar)<br />
window.sidebar.addPanel(title,url,&#8221;");<br />
else if(window.opera &amp;&amp; window.print){<br />
var elem = document.createElement(&#8217;a');<br />
elem.setAttribute(&#8217;href&#8217;,url);<br />
elem.setAttribute(&#8217;title&#8217;,title);<br />
elem.setAttribute(&#8217;rel&#8217;,&#8217;sidebar&#8217;);<br />
elem.click();<br />
}<br />
else if(window.external)<br />
window.external.AddFavorite(url,title);</em><em>}<br />
&lt;/script&gt;</em></p>
<p>Put the following script in your Bookmark this page link (this can be a text or image link) -</p>
<p><em>&lt;a href=&#8221;javascript:bookmark(&#8217;Henrie Media Inc.&#8217;,&#8217;</em><em>http://www.henriemedia/&#8217;);&#8221;&gt;Bookmark this page&lt;/a&gt;</em></p>
<p>Make sure you change the parameters (&#8217;title&#8217;, &#8216;url&#8217;) to the &#8216;url&#8217; you want to bookmark and the &#8216;title&#8217; you want the bookmark to say. In my example the &#8216;url&#8217; is &#8220;http://www.<a href='http://www.henriemedia.com'>Henriemedia.com</a>&#8221; and the &#8216;title&#8217; is &#8220;Henrie Media Inc.&#8221;</p>
<p>That&#8217;s it! Your are off and bookmarking. Please leave a comment if you find this post to be helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/website-strategies/seo-tools/link-analysis/bookmark-this-page-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix for WordPress protected directory returning a 404 error</title>
		<link>http://www.henriemedia.com/technical-support/fix-for-wordpress-protected-directory-returning-a-404-error/</link>
		<comments>http://www.henriemedia.com/technical-support/fix-for-wordpress-protected-directory-returning-a-404-error/#comments</comments>
		<pubDate>Fri, 23 May 2008 20:26:09 +0000</pubDate>
		<dc:creator>Henrie Media Inc.</dc:creator>
		
		<category><![CDATA[Technical Support]]></category>

		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.henriemedia.com/?p=25</guid>
		<description><![CDATA[I just installed WordPress as my default Content Management System (CMS) on Henriemedia.com. WordPress is an awesome open-source web application the provides an easy to use - yet extremely robust - interface and set of tools. I highly recommend using it for your next blog or CMS needs (shameless plug).
Anyways, I installed WordPress in the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wordpress.org" target="_blank"><img class="alignright alignnone size-full wp-image-26" style="float: right;" title="wordpress-crystal-logo" src="http://www.henriemedia.com/wp-content/uploads/wordpress-crystal-logo.jpg" alt="" width="100" height="100" /></a>I just installed WordPress as my default Content Management System (CMS) on <a href='http://www.henriemedia.com'>Henriemedia.com</a>. WordPress is an awesome open-source web application the provides an easy to use - yet extremely robust - interface and set of tools. I highly recommend using it for your next blog or CMS needs (shameless plug).</p>
<p>Anyways, I installed WordPress in the root of my website and kept an administrative subdirectory from my previous website design, which is protected with a password using the &#8220;Protected Directory&#8221; function of Apache. For the sake of this article, we will say that subdirectory is called &#8220;travel&#8221; (there is no such directory on my website so please do not try and find it).</p>
<p>I then configured the WordPress settings for &#8220;Permalinks&#8221; to help with the Search Engine Optimization (SEO) value of my website. Everything was going along great. I started adding content and I was on my way - until I tried accessing the &#8220;travel&#8221; protected directory I setup. Every time I tried to access this folder I would get a 404 error. The reason the 404 error was displaying is because the .htaccess file, which was automatically created by the Permalinks settings, was causing the problem.</p>
<p>WordPress created .htaccess file looks like this -</p>
<p><code>RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]</code></p>
<p>What it does is check to see if the requested filename is a regular file or a real directory.  If it’s neither of the two then redirect to /index.php, which is a WordPress entry. So Apache will load the file or directory instead of WordPress index.php. However, the fact that the requested directory is password protected with its own directory .htaccess file seems to cause Apache to think it’s not really a directory or file, thus satisfying the 2 tests and invoking WordPress&#8217;s index.php - and thus the 404 error.</p>
<p>After days (and I do mean days) of searching the forums on WordPress.org and many other forums, boards and blogs, I found two solutions to this problem.</p>
<p><strong>Please use one OR the other, do not implement both!</strong></p>
<p><strong>First, the .htaccess solution. </strong>NOTE: If you are not comfortable editing the .htaccess file, please scroll down and use the PHP solution. You need to added the following two lines of code to your .htaccess file:</p>
<p><code>ErrorDocument 401 /[path_to_file]/[file_name].html<br />
ErrorDocument 403 /[path_to_file]/</code><code>[file_name]</code><code>.html</code></p>
<p>Remember to change the [path_to_file] and {file_name].html values to the location of your custom error documents. So your the root .htaccess file should now look like this -</p>
<p><code>ErrorDocument 401 /[path_to_file]/[file_name].html<br />
ErrorDocument 403 /[path_to_file]/</code><code>[file_name]</code><code>.html<br />
</code><code>RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]</code></p>
<p>Upload the .htaccess file and you should be up and running. Now I have seen some instances where this solution does not work, for whatever reason, or people do not feel comfortable editing their .htaccess files. If this is the case, please use the PHP solution below.</p>
<p><strong>Second, the PHP solution.</strong> You need to make the following changes to the &#8220;index.php&#8221; file that is in the root directory of your WordPress installation. When you open this file, it should have the following code -<br />
<code><br />
<em>&lt;?php<br />
/* Short and sweet */<br />
define(&#8217;WP_USE_THEMES&#8217;, true);<br />
require(&#8217;./wp-blog-header.php&#8217;);<br />
?&gt;</em><br />
</code><br />
<strong>Make sure you keep a backup copy of the &#8220;index.php&#8221; file just in case (you never know)!</strong></p>
<p>All you have to do is replace the original code with this code -</p>
<p><em>&lt;?php<br />
/* Short and sweet */<br />
$request_filename = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];<br />
$this_dir = dirname(__FILE__).&#8217;/';<br />
if($request_filename!=$this_dir &amp;&amp; $request_filename!=__FILE__ &amp;&amp; (is_file($request_filename) || is_dir($request_filename))) {<br />
// we are not supposed be here!<br />
die;<br />
}<br />
// load WordPress in /wp<br />
define(&#8217;WP_USE_THEMES&#8217;, true);<br />
require(&#8217;./wp-blog-header.php&#8217;);<br />
?&gt;</em></p>
<p>Now save the file and upload the new &#8220;index.php&#8221; file to the root folder of your WordPress installation directory and your done!</p>
<p>What the PHP solution does is it makes sure the request is not for the home directory or index.php itself - this is because you want WordPress to handle these.</p>
<p>Then it tests if the request is a regular file or a real directory - it dies if that’s the case. Basically you are doing what the two RewriteCond lines in .htaccess supposed to do.</p>
<p>Now your password protected directory correctly asks for password instead of showing WordPress&#8217;s 404 error page. All WordPress permalinks work. All non-protected directories work. My &#8220;travel&#8221; subdirectory is now usable again - YAHOO!</p>
<p>I must give credit where credit is due. I found the .htaccess solution on Textpattern.com and the PHP solution on ju-ju.com.</p>
<p>I hope one of these solutions work for you so you don&#8217;t have to waste as much time as I did!</p>
<p>As WordPress&#8217;s motto says &#8220;Code is Poetry&#8221;. Please leave a comment if you find this post to be helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henriemedia.com/technical-support/fix-for-wordpress-protected-directory-returning-a-404-error/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
