473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

MySpace-like .htaccess config with ForceType directive

Hello there thanks for your attention,
I'm tryin to make somethin like myspace with htaccess. Which should be a extension-less link like http://www.mysite.com/username to show user profiles. I can assign "username" to be parsed as php by sth like:
Expand|Select|Wrap|Line Numbers
  1. <File username>
  2.      ForceType application/x-httpd-php
  3. </File>
  4.  
but i don't want to have a specific page called "username" for every user. i want one single page that can parse the URL part after the ending "/" . Can someone help me please?
Aug 22 '07 #1
1 4991
Markus
6,050 Expert 4TB
This is generally done on dynamic websites. A URL such as http://site.com/username will be read as http://site.com/?user=username. This can be accomplished with rewriting the URL.

Htaccess demo:
Expand|Select|Wrap|Line Numbers
  1. RewriteEngine On
  2.  
  3. RewriteRule ^user/(.*)$ /?user=$1 [R]
  4.  
The above would change the URL http://site.com/user/mark to http://site.com/?user=mark. You could then use whatever language you are using to obtain this value (GET).

If you want the URL to be 'masked', change the R flag to L.

Expand|Select|Wrap|Line Numbers
  1. RewriteEngine On
  2.  
  3. RewriteRule ^user/(.*)$ /?user=$1 [L]
  4.  
Jun 4 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: amiri.arash | last post by:
Hi! I want to feed the news section of my band - homepage with the mySpace blog of our band (in order to keep redundancy low). The band homepage is written in PHP. I wrote an xsl-stylesheet...
45
by: marklaa | last post by:
I have created a banner, uploaded it (http://i15.photobucket.com/albums/a382/marklaa/AbsoluteSalsaBanner1.jpg) and now i want to insert this at the top of the page on my myspace site...
0
markmcgookin
by: markmcgookin | last post by:
Hi Folks, First off, Happy New year to all! This is a bit of a strange question, now I am a fairly accomplished .asp and .html web developer, and very computer literate, and I have recently...
3
by: Rico | last post by:
14 year guy takes on Myspace with php http://www.uncov.com/2007/5/10/web-2-0-so-easy-a-14-year-old-can-do-it
1
drhowarddrfine
by: drhowarddrfine | last post by:
MySpace is a coding nightmare. Many web developers will ignore questions about it because it is just too much work and hard to decipher what is going on. The code for it is also non-standard and...
3
by: cozzie49 | last post by:
I recently created my own div overlay layout for myspace, which included a menu i created in flash 8. i uploaded my .swf to fileden CLICK HERE TO SEE and it works perfectly. however, when i...
1
by: natalisharpton | last post by:
I have a myspace banner that I have created and am wanting to post it on a bulletin so when you click on the banner it will bring you directly to my myspace page. How do i do this? please help...
3
by: l23hornet | last post by:
I redesigned my myspace with div overlays, but somehow i have removed the ads from the top of my page. I was wondering if anyone knew a way that i would be able to place it back at the top of my...
6
by: redcanary10 | last post by:
I am fairly new to the html realm and have encountered a problem I can't seem to figure out. I am working on a film myspace ( http://www.myspace.com/mintygreenidiots ) and want to add a table that I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.