• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Personal URL on myspace

New Here ,
Jul 10, 2007 Jul 10, 2007

Copy link to clipboard

Copied

Hi everyone,

I'm trying to duplicate the same effect on my site that myspace.com has on theirs. What they do is give each person a unique url that they can use in promotion. However, when a user clicks, they are sent to a page that is taken from the database.

Here is what I mean:

This is the url that I use to go directly to a person's page: http://www.myspace.com/myuniquename
This is the real url that is brought up: http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=123456789

Can I do this without creating a lot of folders on my site and redirecting?

Thanks,

Simone
TOPICS
Advanced techniques

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 10, 2007 Jul 10, 2007

Copy link to clipboard

Copied

Hi,

If you are using unix / linux servers then you may use the "ln" command and through that you can create "Symbolic links" which look like directories which are actually act as links to one common directory..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 10, 2007 Jul 10, 2007

Copy link to clipboard

Copied

The easiest to implement would be to parse the cgi.path_info. Though not exactly like the MySpace site, the url would include an index.cfm as part of the pathing.

http://www.myClone.com/index.cfm/myUniqueName

Look at the ParseURLData UDF at http://www.cflib.org/udf.cfm?ID=378

A little more complicated is to use something like Mod_rewrite ( http://www.google.com/search?hl=en&q=IIS+mod+rewrite ) which would be handled at the web server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

I'm looking for the same thing. Any way to do it through Cold Fusion and not IIS?

What about:
http://www.myspace.com/application1/myuniquename/
http://www.myspace.com/application2/myuniquename/
http://www.myspace.com/application3/myuniquename/

Could you have CF read the url first?
<cfif SCRIPT_NAME listcontainsNoCase(application1)>
Len( http://www.myspace.com/application3/) - Right (myuniquename/)
<cfset member="myuniquename">

The code above is choppy and would need some cleanup But you get the idea...

Would it work?


Could

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

I used this method: http://www.myClone.com/index.cfm/myUniqueName

on the index page, I parsed the URL using cgi.path_info and redirected to index.cfm?fuseaction=circuit&id=uniqueid

I haven't figured out how do to it with http://www.myClone.com/myUniqueName.

Anyone else have any ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

Yes ISAPI rewrite on IIS or Mod_Rewrite on Apache. They are both designed to do exactly this rather than a hack, bear in mind the cgi.path_info wont work on some web server set ups.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

I'm on a host and don't have access to the web server.

-- Simone

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 20, 2007 Jul 20, 2007

Copy link to clipboard

Copied

Then only the http://www.myClone.com/index.cfm/myUniqueName will work. I would find a host that has Apache and lets you set RewriteRules. It is incredibly powerful and can do much more than just the aforementioned pattern matching!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

Sorry - I replied to the wrong forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 25, 2007 Jul 25, 2007

Copy link to clipboard

Copied

Actually a technique we use is a 404 redirect. Meaning upon any given url not being found for a site ie. www.blah.com/fake directory/. IIS takes that 404 error and sends it to CF, on that CF page you take the cgiQuerystring.. do some logic and then either display your info or do a cflocation redirect.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 03, 2007 Aug 03, 2007

Copy link to clipboard

Copied

LATEST
This sounds like a good method. How do you check for the bad directory name?

-- Simone

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation