I can't seem to get the redirect function to work at all. I have searched high and low through all issues here, and found lots of people having almost similar problems, but no solutions that work.

My installation works in all other aspects, and generates URL's for the ads such as those shown below. But clicking on these will just show the site's front page and not result in any clicks being registered in the ad system.

http://...dk/ad/redirect/159/t113?url=node
http://...dk/ad/redirect/161/t113?url=node/161

The URL's are fully valid and within the site I'm working on. Whether I click the URL or paste it into a fresh browser, Drupal doesn't catch the redirect, but just serves the front page.

I have been debugging the code while it's been running, and it seems that the flow never goes through ad_redirect(), which should do all the magic. The system simply never hits this central function... why can that be?

I have tried a few patches including http://drupal.org/node/330888#comment-1097508 but none have any effect.

And yes, I have cleared all caches, tried several different browsers, been logged in as well as out, tried image and text ads, checked the logs and whatnot, but to no avail.

Martin

Comments

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

Try logging in as uid 1 and then click an ad, does it work then? If so, then it's a Drupal permission error.

Otherwise, check permissions on your files to be sure that you web server has read access to the scripts in your ad/ directory.

vertikal.dk’s picture

Jeremy,

Thanks for your feedback. I have already tried all kinds of situations - logged in and not, admin and registered user and anonymous, different browsers, different computers - but all with the same result.
The system does have full access to the ad directory (/sites/all/modules/ad right?) and I cannot see what might be wrong there to cause the behavior I see.

Oddly enough the redirect works fine on my local development server (my notebook, which runs Apache on Windows XP, using the remote database), although I have to edit the url, which is hard coded to the external server in the database. The redirect works for all roles and users.
But even though the code, database and files are exactly the same on the external development server (Apache on Linux), all I get here is the Drupal front page.

I can't seem to pin down what's wrong on the Linux server.

Martin

jeremy’s picture

This issue got lost in the noise. Is this still an issue for you? How did you copy the system to the Linux server?

If ads are being displayed correctly, then it sounds like the ad module itself is correctly installed. If clicks aren't being tracked, is the click_filter module enabled? If so, disable it and try again.

Do you have any other modules defining the same /redirect path that ad module uses?

vertikal.dk’s picture

Jeremy,

My issue solved itself when I moved the site from the test server (Linux) to the final server (also Linux). It had worked all the time on my local development server (Windows).
The redirects work fine now.

My guess is that the redirect-thing was a server side problem - server configuration, .htaccess or whatnot.
The problem has been "solved" - I don't know exactly how, but alas...

Martin

jeremy’s picture

Status: Postponed (maintainer needs more info) » Fixed

Glad things are working for you now. Closing issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.