Solved

apache rewrite rule

Posted on 2004-08-09
20
494 Views
Last Modified: 2011-09-20
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
Comment
Question by:Nathan_London
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
20 Comments
 
LVL 9

Expert Comment

by:ronan_40060
ID: 11763283
Nathan
pls go through the documenation at
http://www.engelschall.com/pw/apache/rewriteguide/
I will post a reply later on
regards
ronan
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11763403
0
 

Author Comment

by:Nathan_London
ID: 11763781
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Nathan_London
ID: 11763830
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11764420
0
 

Author Comment

by:Nathan_London
ID: 11764947
This doesnt work.

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

Result 404 page not found.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11770230
> Result 404 page not found.
which server does return this?
0
 

Author Comment

by:Nathan_London
ID: 11770389
http://www.mydomain.com/

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11770479
please add [R] to the rule and try again
0
 

Author Comment

by:Nathan_London
ID: 11770909
nope same error. The domain name contains ispy also if that makes a differance.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11771050
pleas enable logging/debugging in mod_rewrite and post logged messages
also post relevant messages from error_log
0
 

Author Comment

by:Nathan_London
ID: 11773448
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11777243
these request do not match what you have asked for.
0
 

Author Comment

by:Nathan_London
ID: 11777811
What do you mean? This is what i want.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11777892
your logfile shows request which never apply to the given rule, which is setup according your given example
0
 

Author Comment

by:Nathan_London
ID: 11778247
the request was http://www.mydomain.com/ispy3214234/

How is that wrong?
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 11779089
damn, didn't read carefully, sorry.

Please replace following part
   RewriteRule .^/ispy(.*)/$
by
   RewriteRule ^/ispy(.*)/$
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

634 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