Greenguy's Board


Go Back   Greenguy's Board > General Business Knowledge
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2009-03-10, 10:12 PM   #1
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
Recips & RegEx help please

I'm trying to set up reciprocal links but have no knowledge with RegEx (regular expressions). I'm not even sure it is possible to do this but before giving up, I thought I'd ask around.

Anyway, this is the base code for the reciprocal link:

Code:
<a href="http://www.exquisiteangelz.com/"><img src="exquisiteangelz.gif" width="120" height="60" border="0"></a>
Now, I would like to know, if it is indeed possible, what is the RegEx code to use so that the "exquisiteangelz.gif" file could be located in any folder, not necessarily in the same folder as the gallery or free site (eg. /images/recips/exquisiteangelz.gif).

Any help would be appreciated. Thank you!
A.J. Angel is offline   Reply With Quote
Old 2009-03-10, 10:49 PM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
To prevent loops, you want to name the recip to something different than exquisiteangelz.gif and use something like:

Code:
RewriteEngine on
RewriteRule .*exquisiteangelz.gif$ /images/recips/exquisiteangelzrecip.gif [L]
you don't want to name it newexquisiteangelz.gif because that would match the regexp and cause a redirect loop.

Keep in mind, anywhere else on your site that you use RewriteEngine on, you will need to use RewriteOptions inherit or add the rule to that .htaccess as well.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2009-03-10, 11:00 PM   #3
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
Quote:
Originally Posted by cd34 View Post
To prevent loops, you want to name the recip to something different than exquisiteangelz.gif and use something like:

Code:
RewriteEngine on
RewriteRule .*exquisiteangelz.gif$ /images/recips/exquisiteangelzrecip.gif [L]
you don't want to name it newexquisiteangelz.gif because that would match the regexp and cause a redirect loop.

Keep in mind, anywhere else on your site that you use RewriteEngine on, you will need to use RewriteOptions inherit or add the rule to that .htaccess as well.
I'm sorry but I'm not sure to understand you. What would be matching the RegEx to cause a redirect loop?

This is actually not for my site but for submitters to link back to my site with the appropriate reciprocal link. |confused|
A.J. Angel is offline   Reply With Quote
Old 2009-03-10, 11:25 PM   #4
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
Code:
RewriteRule .*exquisiteangelz.gif$ /images/recips/exquisiteangelzrecip.gif [L]
This rule will match anything that ends with exquisiteangelz.gif As a consequence, it will also match /images/recips/newexquisiteangelz.gif. So, if you were going to do it, you should rename your recip as exquisiteangelzrecip.gif which wouldn't match the rewrite rule.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2009-03-10, 11:34 PM   #5
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
Oh ok, thanks for the suggestion!

Do you happen to know the RegEx code that would suit my case at the same time?
A.J. Angel is offline   Reply With Quote
Old 2009-03-10, 11:50 PM   #6
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
If I understand what you're asking:

Code:
RewriteEngine on
RewriteRule .*exquisiteangelz.gif$ /images/recips/exquisiteangelzrecip.gif [L]
is what you want.

Store your recip in /images/recips/ as exquisiteangelzrecip.gif

and link to it as <img src="exquisiteangelz.gif">
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2009-03-11, 12:29 AM   #7
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
LOL! No, you completely misunderstood me. What I want is to install the code in my first post with RegEx so that submitters can use that code to link back to my site on their galleries and free sites.
A.J. Angel is offline   Reply With Quote
Old 2009-03-11, 12:47 AM   #8
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
why do you need to use regular expressions to make a recip link?
Beaver Bob is offline   Reply With Quote
Old 2009-03-11, 02:05 AM   #9
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
You want remote sites to be able to hotlink your recip?

Code:
<a href="http://www.exquisiteangelz.com/"><img src="http://www.exquisiteangelz.com/images/recips/exquisiteangelz.gif" width="120" height="60" border="0"></a>
And in the /images/recips/ directory, .htaccess that contains

Code:
RewriteEngine off
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2009-03-11, 03:53 PM   #10
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
Okay, thanks guys for your help!

I have finally found the issue and got it worked.
A.J. Angel is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:05 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc