• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 501
  • Last Modified:

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.
0
Nathan_London
Asked:
Nathan_London
  • 8
  • 8
1 Solution
 
ronan_40060Commented:
Nathan
pls go through the documenation at
http://www.engelschall.com/pw/apache/rewriteguide/
I will post a reply later on
regards
ronan
0
 
ahoffmannCommented:
0
 
Nathan_LondonAuthor Commented:
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
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
Nathan_LondonAuthor Commented:
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 
0
 
ahoffmannCommented:
0
 
Nathan_LondonAuthor Commented:
This doesnt work.

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

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

0
 
ahoffmannCommented:
please add [R] to the rule and try again
0
 
Nathan_LondonAuthor Commented:
nope same error. The domain name contains ispy also if that makes a differance.
0
 
ahoffmannCommented:
pleas enable logging/debugging in mod_rewrite and post logged messages
also post relevant messages from error_log
0
 
Nathan_LondonAuthor Commented:
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/
0
 
ahoffmannCommented:
these request do not match what you have asked for.
0
 
Nathan_LondonAuthor Commented:
What do you mean? This is what i want.
0
 
ahoffmannCommented:
your logfile shows request which never apply to the given rule, which is setup according your given example
0
 
Nathan_LondonAuthor Commented:
the request was http://www.mydomain.com/ispy3214234/

How is that wrong?
0
 
ahoffmannCommented:
damn, didn't read carefully, sorry.

Please replace following part
   RewriteRule .^/ispy(.*)/$
by
   RewriteRule ^/ispy(.*)/$
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 8
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now