Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentGeneral Web Design Discussion right
  Closed Topic Start new topic
left right
haracath
post Sep 14 2009, 09:19 AM
Post #1


Newbie
*

Group: Members
Posts: 8
Joined: 13-August 09
Member No.: 106,324





I own a website which contain a forum of my website. The problem I'm facing is that people'll taking the direct links of myforum and insert hyperlink in to their site. I am getting a huge amount of bandwidth and that's ok, but the number of pages visited is low in my main site. Is there a way or a script that I can add to the links, so that when someone presses on the link from their website, a page from my website opens instead or they cannot link to myforum, so I can get more visits. I using php, Please write to help me a script or code ...and show me where can I insert it?

Thanks!
Go to the top of the page 
 
  + Quote Post
cashloan
post Sep 29 2011, 07:02 AM
Post #2


Member
**

Group: Members
Posts: 30
Joined: 26-September 11
Member No.: 210,615



Your site is hosted by an Apache web server, so you should be able to do the following in your site's httpd.conf (or virtual host block)

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC]
RewriteRule ^/PublicFiles/*$ /page-about-direct-links.html

That is basically saying:

1. Turn the mod_rewrite engine on
2. If the HTTP Referrer is blank...
3. Or doesn't contain my domain name...
4. Or doesn't contain my domain name without wwww...
5. Redirect any requests for anything under /PublicFiles/ to /page-about-direct-links.html
Go to the top of the page 
 
  + Quote Post
ssfdre38
post Sep 29 2011, 07:13 PM
Post #3


THE SILENT FORUM NINJA
*******

Group: Administrators
Posts: 3,711
Joined: 23-January 10
From: on your screen
Member No.: 127,507



for that its in .htaccess cause you can not mod the httpd.conf
Go to the top of the page 
 
  + Quote Post
 Closed Topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 25th May 2013 - 06:48 PM