Disable redirect on directory level

I am using a new tool for inline link ads on my site which can be seen at this url:

http://www.articlesfox.com/?s=facebook&x=0&y=0

But the links inside the hover layers don’t redirect properly which I think is due to the rewrite rules for Wordpress permalinks. How can I add a rule to disable them on the /adintel/ dir level?

ok that finally settles it thank you for all your help!

I wish that link “URI generic syntax” was available as an audio book (:

wheelairservice - will check that out. Can’t imagine that that was the original landing page - must’ve been taken over and redirected by some as$!

Here are two urls one working one not - both fictional so no risk of infection:

doesn’t work:

http://www.articlesfox.com/adintel/stats.php?type=clicks&adID=22&atype=OTHER&url=http://www.google.com&keyword=warcraft

^This is how ALL my links are set up!

This one does work:

http://www.articlesfox.com/adintel/stats.php?type=clicks&adID=22&atype=OTHER&url=/go/warcraft/&keyword=warcraft

So it somehow seems to be the http in the redirecting url that causes the trouble?! :eek:

The links I tested worked - except for wheelairservice which ATTACKED my computer (stopped by Norton, thank you). Enough of that!

Regards,

DK

Yes it’s in the root directory but it isn’t working. The uri is in one of those Javascript links but I don’t know how to retrieve them. This is a page where those hover links are generated :

http://www.articlesfox.com/?s=warcraft&x=0&y=0

I’m not sure what it is maybe it’s something silly on my end that I overlooked but it’s still not working?

oh noooooooooo still not working :injured:

Any idea what could be wrong?

Best

HP

Hi DK,

thanks for your help up to this point and telling me about the unnecessary directives in my .htaccess. Unfortunately it still doesn’t work even though from root /adintel/stats.php exists. It’s really weird. Another workaround to the wordpress rewrite (a super tedious one which is why I am focusing on mod_rewrite) was to use something like gocodes. This DID work but as I said is not really desirable.

so instead of putting a hoplink in the backend like:

http://wowzygor.jmap.clickbank.net
I entered a gocode link for above url

Best

HP

Hospitable,

Actually, IF your directories/files exist in the adintel directory, the two RewriteCond statements SHOULD return false and prevent the WP redirection to index.php.

I can’t NOT comment on three things, though, as

  1. <IfModule> is a test which should NOT be made on every request! Remove those wrappers as they are TOO WASTEFUL of Apache resources! WP only includes that for ID-ten-T’s who do not have mod_rewrite enabled on their server to prevent 500 errors.

  2. RewriteBase is designed to UNDO a mod_alias redirect. Where is that redirect. Less wasteful than the <IfModule>, this is simply useless and should be removed, too.

  3. The / in the RewriteRule’s redirection COULD confuse Apache into thinking you want to access index.php in the ROOT DIRECTORY OF THE SERVER. I.e., remove that leading /, too.

Under other circumstances (i.e., where you have other redirections to handle requests to adintel/), you’d use:

# BEGIN WordPress
RewriteEngine On
RewriteCond &#37;{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond [COLOR="Magenta"]%[/COLOR]{REQUEST_URI} !^[COLOR="Red"]/[/COLOR]adintel/
# HERE is better (IMHO) because the file and
# directory tests have already been made
# ANYWHERE in this block BEFORE the
# RewriteRule is okay, though, as it's just
# a matter of personal preference
RewriteRule .? index.php [L]
# END WordPress

Please note that I’ve “corrected” the WP code for you, too.

Regards,

DK

RewriteCond {REQUEST_URI} !^/adintel/

I highlighted in bold where I tried to insert above rewrite condition

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
[B]HERE[/B]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
[B]HERE[/B]
RewriteRule . /index.php [L]
[B]HERE[/B]
</IfModule>

# END WordPress

Hospitable,

RewriteBase has nothing to do with the RewriteCond statement (except that it might bugger it all up!).

Regards,

DK

since I can’t edit above anymore I’ll add it here:

There may have been some misunderstanding as to what precisely it is that is not working. I didn’t refer to the actual parsing of words and the underlining of the links which works just fine. What doesn’t work is when you prompt the hover box and click on the ad link inside such a box. The result is a 404.

OIC,

What you have is a problem with the use of illegal characters in the query string which is not working (have a good read of http://www.ietf.org/rfc/rfc2396.txt - you’ll find out why if your eyes don’t glaze over!). Remove the http:// from the query string and add it back in with your stats.php script.

Regards,

DK

It’s working on your site for me - except the adintel directory which merely tells me “Access denied.”

I didn’t set it up to work like that but it’s good to know that it does.

So by “it works” what do you mean. I mean the hover link displays but when I click on the link inside I get a 404 what do you get?

so if I just set


RewriteBase /adintel/

would that overwrite or nullify WP’s redirect everything to index.php rule?

Hospitable,

Okay, thanks for that confirmation.

Troubleshooting:

  1. Change the redirection flag from [L] to [R=301,L] to SEE the redirection made by the mod_rewrite. That’ll give you a clue as to what’s happening (lacking access to the mod_rewrite log which can get so detailed as to confuse most people).

  2. To allow others to help troubleshoot, you’ll need to provide the URI(s) that you’re using to test your mod_rewrite. The real URLs are not required as it’s only a “mind exercise” for us without access to your server.

  3. There MAY be other things going on in your server configuration but those are not likely to affect something so trivial.

Regards,

DK

Hostpitable,

Use a RewriteCond (or two) to exclude your link from the redirect EVERYTHING to WP’s index.php.

Regards,

DK

Please provide the current mod_rewrite code from your .htaccess (okay, ALL of your .htaccess if you have anything else which might impact it).

Regards,

DK

Hospitable,

Did I do that? REMOVE the / from !^/adintel/ as

# BEGIN WordPress
RewriteEngine On
RewriteCond &#37;{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond [COLOR="Magenta"]%[/COLOR]{REQUEST_URI} !^adintel/     
[COLOR="Red"]# removed the / which would ONLY work on Apache 1.x[/COLOR]
# HERE is better (IMHO) because the file and
# directory tests have already been made
# ANYWHERE in this block BEFORE the
# RewriteRule is okay, though, as it's just
# a matter of personal preference
RewriteRule .? index.php [L]
# END WordPress

Sorry about that!

Regards,

DK

Since I tried

RewriteCond {REQUEST_URI} !^/adintel/

and various permutations with and without the slashes for the directory I am starting to think that maybe it has something to do with the fact that the url isn’t encoded? :confused:

http://www.articlesfox.com/?s=warcraft&x=0&y=0 you’ll see what I mean if you click on one of the hover ads.