Solved

ht access problem

Posted on 2004-08-15
8
445 Views
Last Modified: 2013-12-24
hello,

i was using htaccess file to redirect my exe file extchang.exe to a php file (a download counter which count the download number then lauch thee exe file):

Redirect /extchang.exe http://www.yehiaeg.com/extchanger/dcounter.php?file=../extchang.exe

the problem is when extchang.exe is redirect to the php file, the php file launch extchang.exe again after counting the download number which brings us back again to the php file again and again...

So, who to resolve this?

Thanks
Yehia
0
Comment
Question by:yehiaeg
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 15

Expert Comment

by:periwinkle
ID: 11806100
Clicking on the link above brought me to a download page?
0
 

Author Comment

by:yehiaeg
ID: 11806259
forget about the links above, it's not demonstrating what i want
0
 

Expert Comment

by:badjuju1
ID: 11813572
Couple questions - is your website on a Linux or Windows server?
If it's on Linux, then you cannot use that program since Linux does not execute .exe files.

Also, if it's on Windows, you will not get the results you want since most browsers will prompt users to download an .exe file before they can run it.

Generally, most users will not execute an .exe file since this is a major security loophole - the file may be a trojan.
You're better off using a script written in php or perl.
0
 
LVL 33

Expert Comment

by:humeniuk
ID: 11836017
Good point from badjuju - if the .exe is for download, you might want to zip it first.

Here are a couple of good PHP/MySQL download counter scripts you should look at:

Sunk Media Download Counter (free) - http://cgi.sunkmedia.plus.com/index.php?module=viewscript&sid=7d6e183a9368e216b3e9df8554e06230&scriptid=2

and

Mike's Download Counter (GPL) - http://www.mikeleigh.com/dev/downloadcounter/index.php

Good luck.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:yehiaeg
ID: 11836651
what does "Linux does not execute .exe files" with me, i think u misunderstood my problem:

i am using a download counter for test.exe
in the htaccess file i added  Redirect /test.exe http://www.yehiaeg.com/dcounter.php?file=/test.exe
so that any old sites linking directly to my exe will have to pass first to the counter

the problem is here,when dcounter.php links the users browser to my test.exe after adding +1 to a text file :
$cm = "Location: $file";
header ($cm);
this results a loop cause when the header function passes the browser to test.exe ,the htaccess file redirects again the browser to the counter and so on
0
 

Expert Comment

by:badjuju1
ID: 11837581
After looking at your server spec, I can see it is hosted on a Unix/Linux server. This means that .exe files will not work. You can look for a script-based counter online.



YEHIAEG.COM

 SSL Cert:  No valid SSL on this Host, Get Secure
Website Status:  Active
Reverse IP:  Web server hosts 7989 websites (reverse ip tool requires free login)
Server Type:  Apache/1.3.31 (Unix) FrontPage/5.0.2.2634 (Spry.com also uses Apache)
IP Address:  64.202.166.210 (ARIN & RIPE IP search)
IP Location:   - Arizona - Mesa - Go Daddy Software Inc
Record Type:  Domain Name
Monitor:  Monitor or Backorder
Wildcard search:  'yehiaeg' or 'hi' in all domains.
Other TLDs:  .com .net .org .info .biz .us
X      [5 available domains]
 
Name Server:  WSC1.JOMAX.NET WSC2.JOMAX.NET
ICANN Registrar:  GO DADDY SOFTWARE, INC.
Created:  10-jul-2004
Expires:  10-jul-2005
Status:  ACTIVE
 
 
0
 

Accepted Solution

by:
fetchmaster earned 125 total points
ID: 11900685
As i see it,

$cm = "Location: $file";
header ($cm);

Is creating the problem as it requests apache to deliver the file. You can override this by simply interchanging the two lines with

readfile($file);

Here we are using filesystem function to output the file. If your file size is too big and takes more time to download, put  

set_time_limit(1000);

at  the starting of the dcounter.php file and it must work.
0
 

Expert Comment

by:fetchmaster
ID: 12132140
:) yehiaeg, thats nice to accept my answer. keep the spirits up.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: IanTh
Hi Guys After a whole weekend getting wake on lan over the internet working, I thought I would share the experience. Your firewall has to have a port forward for port 9 udp to your local broadcast x.x.x.255 but if that doesnt work, do it to a …
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now