Gossamer Forum
Home : General : Perl Programming :

apache rewrite regex

Quote Reply
apache rewrite regex
Probably a simple apache rewrite rule but i just can get it to work. Help if you can!

What it is;
Webmaster place links to my site using the following link;

https://secure.ibill.com/...p://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/...p://www.mydomain.com

Using the ispyxxxxxx from the original link as the variable.

Thanks in advance for any help.

I have tried RewriteCond %{REQUEST_URI} ^/ispy
RewriteRule .^/ispy(.*)/$ https://secure.ibill.com/...p://www.mydomain.com
Quote Reply
Re: [catlovette] apache rewrite regex In reply to
Hi. You could try something like;


Code:
RewriteRule .^ispy/.*?/? https://secure.ibill.com/cgi-win/ccard/rscookie.exe?RevShareID=ispy$1&returnto=http://www.mydomain.com

That should work for;

http://www.mydomain.com/ispy/xxxxxx/

Hope that helps.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!