473,419 Members | 1,687 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,419 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 4992
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.