hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : PURL scripts
Reply

Forum Jump

PURL scripts

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-04-2011, 01:14 PM
raulb raulb is offline
Junior Guru Wannabe
 
Join Date: Feb 2008
Posts: 39

PURL scripts


I was wondering if anybody knew of any good resources for PURL creation and scripts? or point me to a forum post on the subject?


Thanks!



Sponsored Links
  #2  
Old 11-04-2011, 01:20 PM
bear bear is offline
Community Leader
 
Join Date: Oct 2002
Location: Mayberry
Posts: 19,043
Perhaps you mean PERL (Practical Extraction and Reporting Language)?

You could start here: http://www.google.com/search?q=perl+...2&spell=1&sa=X

__________________
Have problems (don't we all)? Head over to the help desk



  #3  
Old 11-04-2011, 01:21 PM
raulb raulb is offline
Junior Guru Wannabe
 
Join Date: Feb 2008
Posts: 39
Thanks for the response but I actually meant PURL http://en.wikipedia.org/wiki/Persist...source_Locator

I also did a google search for PURL but only found companies that offer the software/services for sale and I was hoping to find an open
source solution or some helpful scripts to get me going.

Thanks!

Sponsored Links
  #4  
Old 11-04-2011, 01:31 PM
bear bear is offline
Community Leader
 
Join Date: Oct 2002
Location: Mayberry
Posts: 19,043

__________________
Have problems (don't we all)? Head over to the help desk



  #5  
Old 11-04-2011, 01:39 PM
raulb raulb is offline
Junior Guru Wannabe
 
Join Date: Feb 2008
Posts: 39
Thanks again, but unfortunately that search was not helpful either. I just want to learn how to make PURLS in php server side. Its being used for a marketing campaign.

  #6  
Old 11-06-2011, 01:09 PM
webstartavenue webstartavenue is offline
Newbie
 
Join Date: Nov 2011
Posts: 29
Your Wikipedia reference links to Persistent URLs - these are simply HTTP status codes coupled with a URL. An example of implemented a 301 redirect (permanently moved) would be:
Code:
<?php
header( "HTTP/1.1 301 Moved Permanently" ); 
header( "Location: http://www.new-url.com" );
?>
However, I suspect that you may have meant Personalized URLs - often used in marketing campaigns for tracking and personalization.

To create these types of PURLs (such as Username.Domain.com) you will need to setup wildcard subdomains in the DNS records (looks like *.domain.com) and then setup all subdomains to route to a specific PHP script for handling. This can be easily done using mod_rewrite in Apache via .htaccess. Note that most shared hosts do not allow wildcard subdomains.

  #7  
Old 11-06-2011, 01:16 PM
raulb raulb is offline
Junior Guru Wannabe
 
Join Date: Feb 2008
Posts: 39
Thanks for the reply that has been helpful!
Yes I meant Personalized URLS, do you know of a tutorial or source that shows you the steps to set this up? We own our server so we have access to try this.

  #8  
Old 11-06-2011, 01:59 PM
webstartavenue webstartavenue is offline
Newbie
 
Join Date: Nov 2011
Posts: 29
I don't know of any great tutorials so here's a quick write-up.

Basic steps for setting up a Wildcard subdomain (assuming a LAMP stack):

1) DNS Record

Add a DNS record, here are the settings:
Type: "A" Record (More information on DNS record types)
Name: *.DOMAINNAME.TLD
Content: IP Address of your Server
TTL: 300 (300 typically works well for me)

2) Setup/Modify the Apache Virtual Host
On the ServerAlias config line add *.DOMAINNAAME.TLD. It should roughly look something like:

Code:
<VirtualHost *:80>
  ServerName  DOMAINNAME.TLD
  ServerAlias *.DOMAINNAME.TLD

  ...
</VirtualHost>
3) Setup .htaccess to rewrite requests to your PHP file
In your directory specified in the VirtualHost add a file called .htaccess. Mine looks something similar to:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
I'm basically telling all requests to this URL to go to index.php. You could also specify only patterns making your personlized URLs.

4) Write your Personalized PHP script
Which ever file you redirect to in .htaccess will need to begin the process of analyzing the $_SERVER array to determine what to display to the user.

  #9  
Old 11-17-2011, 12:49 PM
raulb raulb is offline
Junior Guru Wannabe
 
Join Date: Feb 2008
Posts: 39
@webstartavenue Thank you for this! This is actually very helpful and gets me in the right direction.

Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scriptalicious Holiday Discount - 30% Off SEO Scripts, AJAX Scripts & More! Tekime Software & Scripts Offers 2 12-18-2009 01:59 AM
Web Scripts Directory : Search-Scripts.com Review Requested Chadha Web Site Reviews 7 08-08-2007 05:28 AM
Iframe Scripts. Scripts easy to include to your web design lasse Other Offers & Requests 0 10-14-2006 08:12 AM
Iframe Scripts. Scripts easy to include to your web design lasse Design Offers 0 10-01-2006 06:37 AM
50% Off All PHP Scripts (WHT only): Hosting Directory Script, Order Form Scripts + adscas77 Other Offers & Requests 10 05-27-2005 11:44 AM

Related posts from TheWhir.com
Title Type Date Posted
Admin-Ahead Server Technologies Listing 2014-04-19 00:31:18
Hackers Pack More Sophistication into Simple Scripts to Attack PHP Applications Web Hosting News 2013-09-09 11:52:48
Softaculous Releases Auto Installer Version 4.1.7 Web Hosting News 2012-12-19 16:45:21
Web Host LogicWeb Launches CloudLinux-Based Web Hosting Service Web Hosting News 2012-09-26 16:54:35
NephoScale Appeals to DevOps with New Public Cloud Infrastructure Tool Web Hosting News 2012-08-16 16:16:42


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?