Solved

apache rewrite rule

Posted on 2004-08-09
20
493 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use of SSL Certificates - http vs https 3 97
Issues installing SSL certificate into Apache Tomcat 3 120
HHTP and HTTPS redirect question 3 144
Apache LDAP Authentication 20 72
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

734 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