danwellman
danwellman

Reputation: 9273

Possible Wordpress URL rewriting issue

I've just installed wordpress at the root of my site and created a custom theme, you can see it at www.danwellman.co.uk

I have a problem with the form attached to the 'Contact' tab near the top-right of the header - this is a jQuery plugin which makes a POST request to a PHP file to send an email to my hotmail.

before installing wordpress this was working perfectly, but since installing wordpress it no longer works. After completing the form and hitting send the index.php page is returned to the form.

What should happen is the form should send the data to my PHP file (sendMail.php) but it looks like the request to /sendMail.php is being rewritten to /index.php instead.

I tried deleting the .htaccess file from the root of my site as a test but it didn't seem to make any difference.

Can anyone advise?

Upvotes: 0

Views: 131

Answers (2)

Gipetto
Gipetto

Reputation: 1048

The script isn't posting to /sendMail.php its simply going to / which is picked up by WordPress. The Script that manages the form appears to get its posting URL from the current page url (ie: it wants to post to itself).

The script looks to get its posting url from your contact link which is set to "sendMail.php/" - note the trailing slash. Fix this to remove the trailing slash in that link and I'll wager that it'd work.

Upvotes: 1

Jordan Ryan Moore
Jordan Ryan Moore

Reputation: 6887

There are a couple of problems. First of all, the contact link's href attribute is sendMail.php/. It should be /sendMail.php. Second of all, the following JavaScript needs to change from:

$(".contact", "#nav").jMailer({ suppressTo:true, message:"" }); 

to:

$(".contact a", "#nav").jMailer({ suppressTo:true, message:"" }); 

It actually has nothing to do with WordPress or the .htaccess file.

Upvotes: 2

Related Questions