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.
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.
RewriteCond %{REQUEST_URI} ^/ispyxxxxxx/$
RewriteRule . https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispyxxxxxx&returnto=http://www.mydomain.com
RewriteRule . https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispyxxxxxx&returnto=http://www.mydomain.com
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
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
ASKER
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
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
RewriteCond %{REQUEST_URI} ^/ispy
RewriteRule .^/ispy(.*)/$ https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispy$1&returnto=http://www.mydomain.com
RewriteRule .^/ispy(.*)/$ https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispy$1&returnto=http://www.mydomain.com
ASKER
This doesnt work.
http://www.mydomain.com/ispy123456/ etc.
Result 404 page not found.
http://www.mydomain.com/ispy123456/ etc.
Result 404 page not found.
> Result 404 page not found.
which server does return this?
which server does return this?
ASKER
http://www.mydomain.com/
please add [R] to the rule and try again
ASKER
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
also post relevant messages from error_log
ASKER
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/
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.
ASKER
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
ASKER
the request was http://www.mydomain.com/ispy3214234/
How is that wrong?
How is that wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
pls go through the documenation at
http://www.engelschall.com/pw/apache/rewriteguide/
I will post a reply later on
regards
ronan