Note that there are some explanatory texts on larger screens.

plurals
  1. POMod Rewrite Producing 404 When Crawled (works fine when viewed in browser)
    primarykey
    data
    text
    <p>I have the following code in my .htaccess:</p> <pre><code>RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </code></pre> <p>My pretty-link converting is done on my index.php. If the user is looking for something that doesn't exist, a 404 Header is produced, otherwise content is show.</p> <p>That is all fine and dandy, however when a crawler or something tries to view the HTML, they are getting a 404 error.</p> <p>For example:</p> <p><a href="http://www.jasonleodurbin.com/portfolio" rel="nofollow noreferrer">http://www.jasonleodurbin.com/portfolio</a> That link should work fine. </p> <p>If you try to validate it at an HTML validator, it doesn't work. The crawler says it is getting a 404. I am getting the same for Facebook share.</p> <p>I've tried removing the 404 error header, and I am still getting the same problem. </p> <p>What is the deal? Any suggestions?</p> <p>EDIT:</p> <p>New .htaccess:</p> <pre><code>RewriteEngine On RewriteCond %{HTTP_HOST} ^jasonleodurbin\.com$ [NC] RewriteRule ^(.*)$ http://www.jasonleodurbin.com/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z]+)/$ index.php?go=$1&amp;app=1 [NC,L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z]+)?success=true index.php?go=$1&amp;success=1 [NC,L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z]+) index.php?go=$1 [NC,L,QSA] </code></pre> <p>Processing:</p> <p>globals.php</p> <pre><code>if(!isset($_GET['go']) || $_GET['go'] == "") $_GET['go'] = "home"; </code></pre> <p>header.php</p> <pre><code>if(isset($_GET['go']) &amp;&amp; !@fopen(strtolower($_GET['go']).".php",'r')){ //header("HTTP/1.0 404 Not Found"); define("FAIL",true); $_GET['go'] = "error"; } else { define("FAIL",false); Header('HTTP/1.1 200'); } if(FAIL) define("GOSUB",DIR); if(isset($_GET['app'])) define("GOSUB","../"); else define("GOSUB",""); </code></pre> <p>I've also tried this for the index.php:</p> <pre><code>&lt;?Header('HTTP/1.1 200 OK');?&gt; &lt;? require_once("header.php");?&gt; &lt;? require_once(strtolower($_GET['go'].".php"));?&gt; &lt;/div&gt; &lt;/div&gt; &lt;? if(!defined("FOOTER"))define('WP_USE_THEMES', false); define("FOOTER",true); include("blog/index.php"); ?&gt; &lt;!--[if IE]&gt; &lt;a href='http://www.google.com/chrome' title='Get Google Chrome : A Better Way To Browse' class='noie sprite-1'&gt;IE Sucks&lt;/a&gt; &lt;![endif]--&gt; &lt;!--[if lt IE 7]&gt; &lt;div style='position:absolute;top:60px;left:0px;'&gt;&lt;b&gt;IE 6&lt;/b&gt;?! Dude, upgrade. &lt;br&gt;Click the link above to get Google Chrome.&lt;/div&gt; &lt;![endif]--&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Something is sending the 404 before I can even send 200.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload