Link to home
Start Free TrialLog in
Avatar of Nathan_London
Nathan_London

asked on

apache rewrite rule

Probably a simple apache rewrite rule.

Webmaster place links to my site using the following link;

https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispyxxxxxx&returnto=http://www.mydomain.com

I don’t want them to click on this link because it isn’t a direct link to my site and therefore won’t help my Page Rank in Google.

I want them to link directly using to something like;

http://www.mydomain.com/ispyxxxxxx/

ispyxxxxxx being unique for each webmasters link.

What would my rewrite rule be to have user click on http://www.mydomain.com/ispyxxxxxx/

Then redirect them to https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispyxxxxxx&returnto=http://www.mydomain.com

Using the ispyxxxxxx from the original link.

Thanks in advance for any help.
Avatar of ronan_40060
ronan_40060
Flag of United States of America image

Nathan
pls go through the documenation at
http://www.engelschall.com/pw/apache/rewriteguide/
I will post a reply later on
regards
ronan
Avatar of Nathan_London
Nathan_London

ASKER

How does it know?
ispyxxxxxx should be a variable

Would it for example change;

http://www.mydomain.com/ispy123456/
to
https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispy123456&returnto=http://www.mydomain.com 

http://www.mydomain.com/ispy789102/
to
https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispy789102&returnto=http://www.mydomain.com 


Nathan
or if it makes it easier to use a common directory /revshare/;

http://www.mydomain.com/revshare/ispy123456/
https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispy123456&returnto=http://www.mydomain.com 

http://www.mydomain.com/revshare/ispy789102/
https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispy789102&returnto=http://www.mydomain.com 
This doesnt work.

http://www.mydomain.com/ispy123456/ etc.

Result 404 page not found.
> Result 404 page not found.
which server does return this?
http://www.mydomain.com/

please add [R] to the rule and try again
nope same error. The domain name contains ispy also if that makes a differance.
pleas enable logging/debugging in mod_rewrite and post logged messages
also post relevant messages from error_log
404 in apache log

Tries to apply /ispy3214234/ to all rewites then pass through;

IP - - [11/Aug/2004:14:27:58 +0000] [www.ispy247.com/sid#80bd0c4][rid#9d9cfec/initial] (3) applying pattern '.^/ispy(.*)/$' to uri '/ispy3214234/'
IP - - [11/Aug/2004:14:27:58 +0000] [www.ispy247.com/sid#80bd0c4][rid#9d9cfec/initial] (1) pass through /ispy3214234/
these request do not match what you have asked for.
What do you mean? This is what i want.
your logfile shows request which never apply to the given rule, which is setup according your given example
the request was http://www.mydomain.com/ispy3214234/

How is that wrong?
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial