Simple Download Monitor problems

Started by pepak, November 04, 2009, 11:46:40 AM

Previous topic - Next topic

pepak

Quote from: "Forge"Hello Pepak

Your plugin don't work on my website.
I've change the htaccess and place file (zip) into directory named ,,fichiers" (i'm french) in the root (/www/fichiers).

- Where the dir ,,fichiers" can be place ?
- this is my lines in htaccess :
RewriteRule ^(fichiers/.*) /index.php?sdmon=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f

Is it ok ?

Thanks

pepak

Placement of the downloads directory
The downloads directory can, theoretically, be placed anywhere in the directory tree of your website. You just need to make sure that two places are set up accordingly:

1) The .htaccess file located in the root of your WordPress installation (that is, suppose that your WordPress files - wp-config.php and others - reside in /www directory; then you need to edit /www/.htaccess file, not any other .htaccess file you may possibly have) needs to have a RewriteRule added to it:
RewriteRule ^(files/.*) /index.php?sdmon=$1 [L]Where files is a relative path to your download directory, relative to that .htaccess file. E.g., if your downloads are placed in /www/deeply/hidden/files and your WordPress is in /www, you will want
RewriteRule ^(deeply/hidden/files/.*) /index.php?sdmon=$1 [L]
2) Plugin's configuration needs to reflect the placement as well. The "Allowed directories" will almost always contain the same text as your RewriteRule, before .*. E.g., in the example above, deeply/hidden/files/

Why it doesn't work
That's quite difficult to tell. What exactly happens if you try to download an existing file, e.g. www.yourwebsite.fr/fichiers/public.zip? And what happens if you use www.yourwebsite.fr/index.php?sdmon=fichiers/public.zip instead? If #2 works and #1 does not, your .htaccess file is either wrong or even ignored by your webhost. If neither of them work, it is likely the plugin's configuration is incorrect. I'll need to know which it is before I can suggest further steps.

Forge

The second soluce " www.yourwebsite.fr/index.php?sdmon=fichiers/public.zip " work perfectely.
I searching to resolve htaccess problem.

I put this link waiting solution.

pepak

That means your .htaccess file is either not working at all - some (many?) webhosts don't allow its use at all or with strict limitations.

What kind of URLs do you use for your WordPress posts? That is, if you post an article about "It is not working!", how exactly will its URL look? Will it be something like www.mywebsite.fr/2009/11/it-is-not-working or rather something like www.mywebsite.fr/index.php?id=123? If it is the first case, your webhost supports .htaccess and we just need to find out what's wrong with yours. The other case could mean that either you didn't even try to use "cool URI's" and left WordPress in its default state (SDM might still work if you write a proper .htaccess), but it could also mean that your webhost doesn't support .htaccess and you won't be able to use SDM at all.

Btw., you don't need to register to be able to post here. Although, registration brings the benefit that you can select your language here and translate the whole forum.

Forge

It work in the first case.

...to late for inscription ^_^

pepak

If your .htaccess doesn't contain any sensitive data, send it to me (pepak (at) pepak.net) and I'll check it.

Forge

htaccess sent.

Another question : is it possible to print this count in post ?
Ex: "Myfile donwloaded 30 times"

pepak

Not really. The plugin doesn't even know from which page (if any) the file was linked. Theoretically, I could publish a function which would return a number of downloads that could be called from a template, but it really seems like it'd be out of the intended scope.

As for your .htaccess, I am surprised it works at all :-)
I admit I am no htaccess wizard, though.

Try to replace the two lines with:
RewriteBase /
RewriteRule ^(fichiers/.*) /index.php?sdmon=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

pepak

If that doesn't work, it may actually be the case of your webhost not supporting .htaccess. I have just tried accessing the site, and:

1) The site's URLs are not, in fact, "cool URIs" - they are regular PHP links, although in a bit unusual syntax (/index.php/parameters is interpreted by PHP the same way as /index.php?parameters). Still, they work without ANY help from htacceess (what htaccess allows is /parameters).

2) I tried accessing the site with www1. instead of the starting www.. Your htaccess should have rewritten it to a www. form, but it didn't - it just let me go to a www1. version of your site, which leads to an empty directory. So it seems .htaccess is ignored completely. That would, of course, prevent SDM from working.

Forge

It doesn't work.

This file is on the top of this page with the link "hack" (with index?sdmon=) and "no hack" (simply linked)
http://www.masterfight.net/index.php/diffusez-masterfight/

pepak

I am afraid you will need to contact your webhoster and ask them why .htaccess (or mod_rewrite) is being ignored. Wihout htaccess and mod_rewrite, the plugin can't function as intended (you could still post all your downloads as /index.php?sdmon=fichiers/file.zip, but that would defeat the whole point that the monitor can track downloads even from direct links).

Forge

Ok i try this.
Thanks a lot for your help and your good job.

Ricardo

Hi

When using your plugin all the files "covered" by the plugin wont appear on the blog...for example i have a folder onmy server called "images" if i setup simple download monitor to that folder the images wont display on a post:

example:

http://www.mydomain.com/images/test.jpg" />

nothing appears on the blog, if i erase the lines from the .htacess file they appear

What can i do to solve this?

Thanks

pepak

I never actually tried or intended to use the plugin with images. I'll test it and see what can be done.

Ricardo

i tried other files like swf and same thing happens...by using your plugin i can see who is hotlinking to my files...i dont have acess to the stats on my server so i was hoping your plugin would tell me if anyone hotlinks to my files.

Quick Reply

Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Shortcuts: ALT+S post or ALT+P preview