Forum Moderators: phranque
I have a big problem <snip>. When I access the site the main page is shown correctly, but I recently found out that it returns a 404 error in the server response header.
The whole site is working but all the pages return a 404 error and don't know why. The site is run by cubecart 3.0.13 and is hosted on a unix server with apache 2.2.8.
I would appreciate if you could help me solve this very annoying problem.
Thanks in advance,
zsigmondre
[edited by: jdMorgan at 6:51 pm (utc) on June 26, 2008]
[edit reason] No URLs, please. See Terms of Service. [/edit]
<FilesMatch .asp>
SetHandler application/x-httpd-php5
</FilesMatch>
DirectoryIndex index.asp index.php index.htm index.html
redirect 301 /wordpress http://www.example.com/blog
redirect 301 /index.php http://www.example.com/store/
And the one in the store directory is this:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/store/$1 [R=301,L]
RewriteCond %{QUERY_STRING} (.+)
RewriteRule cat_(.*).html index.php?act=viewCat&catId=$1&%1 [L]
RewriteRule cat_(.*).html index.php?act=viewCat&catId=$1 [L]
RewriteCond %{QUERY_STRING} (.+)
RewriteRule prod_(.*).html index.php?act=viewProd&productId=$1&%1 [L]
RewriteRule prod_(.*).html index.php?act=viewProd&productId=$1 [L]
RewriteCond %{QUERY_STRING} (.+)
RewriteRule info_(.*).html index.php?act=viewDoc&docId=$1&%1 [L]
RewriteRule info_(.*).html index.php?act=viewDoc&docId=$1 [L]
RewriteCond %{QUERY_STRING} (.+)
RewriteRule site_(.*).html index.php?act=viewDoc2&docId2=$1&%1 [L]
RewriteRule site_(.*).html index.php?act=viewDoc2&docId2=$1 [L]
RewriteCond %{QUERY_STRING} (.+)
RewriteRule tell_(.*).html index.php?act=taf&productId=$1&%1 [L]
RewriteRule tell_(.*).html index.php?act=taf&productId=$1 [L]
I'm not sure what the problem is but it's causing me a lot of headache.
[edited by: jdMorgan at 4:26 pm (utc) on June 28, 2008]
[edit reason] Use example.com. See TOS. [/edit]
Do you get 404s on /wordpress requests, on /index.php requests, on /cat_, /prod_, /info_, /site_, /tell_ requests, or on *all* requests?
[added] Please use example.com instead of your own domain. Otherwise, this thread may out-rank your own site by tomorrow for a search on your domain name. I'm not sure you'd want your competitors to know about your trouble, either... [/added]
Jim
[edited by: jdMorgan at 4:32 pm (utc) on June 28, 2008]
zsigmondre
This purpose of this kludge was for use on Web hosts that did not support mod_rewrite, as it was the only way to pass control to a script without using a redirect. It was popular on GeoCities, for example. But this was well before the Web went commercial and search engine ranking became important. Since browsers didn't really care about getting a 404 and displayed the resulting pages just fine, it worked well enough in its time.
It is possible that your cart still uses this method, or that it uses it unless told to use mod_rewrite. I don't know anything about cubecart, but you might want to check out their documentation and/or forums to see if there is any mention of this.
If you can configure it to use mod_rewrite as a built-in option, then do so. If not, then look at any .htaccess file in cubecart's subdirectory, and see if there is an ErrorDocument directive pointing 404's to the script. If so, it can likely be replaced with a mod_rewrite ruleset, avoiding this 404 problem.
Jim
zsigmondre
If there is no ErrorDocument directive pointing to a page-generation script, then it's fairly likely that the script itself is generating the 404s.
Sorry I can't be of more help -- this is a nasty problem... :(
Jim