Contact page route /contacts/index gives 404 error, but works with /index.php/contacts/index

magento.stackexchange https://magento.stackexchange.com/questions/328835

  •  15-04-2021
  •  | 
  •  

Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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]

Make sure the contact form is enabled in the backend:

System -> Configuration -> General -> Contacts -> Contact Us -> Enable

Work for me.

In your template

/template/contacts/form.phtml

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

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top