0

So, up until about an hour ago, my magento contact page was working fine.

Then, all of a sudden, the server immediately serves a 404 error.

The rest of the site's pages are fine, but this one breaks.

It works fine though if I prepend the URL with /index.php/, which makes me think this is a .htaccess/mod_rewrite problem, but its stumping me as to why its only affecting one page.

URL for reference: http://industrywest.cobblehilldigital.com/contacts/index/

It seems to be searching for contacts.xml/index, according to the 404 error thats thrown, but I cant be sure thats not how magento does things normally ).

DISCLAIMER: I am NOT by any means a magento expert, but any help would be greatly appreciated. I am relatively well versed in working with apache and linux though, in case I need to be.

  • SO, i'm going to go head and answer my own question. This issue was not caused by .htaccess OR broken template. The issue was that I had an xml file in my magento root, which confused the .htaccess into looking for the xml file in the root, RATHER than routing the request through ~/index.php/. The files were somehow hidden in my IDE (don't really know why), so check for that. If you happen to get an issue where it's trying to find an XML file for the default route of a page, and ~/index.php/path/to/file works, check for this, might solve it for you. – Trevor Wagner Mar 9 '15 at 17:51
1

If you go to: http://industrywest.cobblehilldigital.com/contacts you don't have a 404 error but a page with a broke template.

Possible ideas:

1) A Magento module conflict with base magento contact form 2) You have a CMS page with url-key "contacts" and template customization not correctly. If this true, just create a new one (delete the old) with this code block inside:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

Hope these can help.

| improve this answer | |
  • So, I wasn't building the contact form using a CMS page before, but I went back and did that, and now it shows up, but when I try to send the form, it can't find the route for the post request. I think your advice about a conflict is the most correct answer so far. – Trevor Wagner Feb 27 '15 at 15:29
0

There is something wrong with your URL rewriting.

/contacts url rewrites to /contacts.xml/

Check your .htaccess file and make sure your rewrites properly setup

Here is example I have in mine:

<IfModule mod_rewrite.c>

############################################
## enable rewrites

RewriteEngine on        
Options +FollowSymLinks 

############################################
## you can put here your magento root folder
## path relative to web root

#RewriteBase /magento/

############################################
## uncomment next line to enable light API calls processing

#    RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]

############################################
## rewrite API2 calls to api.php (by now it is REST only)

RewriteRule ^api/rest api.php?type=rest [QSA,L]

############################################
## workaround for HTTP authorization
## in CGI environment

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

############################################
## redirect for mobile user agents

#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]

############################################
## always send 404 on missing files in these folders

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

RewriteRule .* index.php [L]

| improve this answer | |
  • This isn't it. both my .htaccess on my staging site and beta site match up to this. But thanks, though – Trevor Wagner Feb 27 '15 at 0:02
-1

In your template

/template/contacts/form.phtml

change form action from contacts/index/post/ to contacts/index/save/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.