473,396 Members | 2,036 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,396 software developers and data experts.

blogs and 'virtual directories'

Hi,

Throughout the past few years, I've been working on a personal blog
that I've written using PHP. I recently noticed that a lot of blogs
support the following URL syntax:

/archives/2004/04/03/
/archives/2004/03/
/archives/2004/

and so on and so forth. The thing is, they obviously don't have an
actual HTML or PHP page in that directory; I doubt even that those
directories actually exist. My guess is that they are doing some sort of
URL re-writing using .htaccess in combination with perhaps a single PHP
page that takes in parameters as a GET query. It's just a guess, of
course.

The thing is: I really have no idea how they are doing this.

So, how would I implement something like this on my site using Apache
and PHP? What is the technical term for this style of 'URL re-writing'
even called? I don't mind doing a little research on my own, but I can't
seem to nail down exactly what keywords I need to search for in the
first place!

Any pointers or examples would be greatly appreciated.

Regards,

--
titus barik (ti***@barik.net) | www.barik.net | aim: tbarik
Italian's windscreens solitude workbench's lecture catering
steerage's Mercado nuncio's beefed indicting adeptness carped
Jul 17 '05 #1
1 1482
On Sun, 9 May 2004 02:33:34 +0000 (UTC), Titus Barik <ti***@barik.net> wrote:
Throughout the past few years, I've been working on a personal blog
that I've written using PHP. I recently noticed that a lot of blogs
support the following URL syntax:

/archives/2004/04/03/
/archives/2004/03/
/archives/2004/

and so on and so forth. The thing is, they obviously don't have an
actual HTML or PHP page in that directory; I doubt even that those
directories actually exist. My guess is that they are doing some sort of
URL re-writing using .htaccess in combination with perhaps a single PHP
page that takes in parameters as a GET query. It's just a guess, of
course.

The thing is: I really have no idea how they are doing this.

So, how would I implement something like this on my site using Apache
and PHP? What is the technical term for this style of 'URL re-writing'
even called? I don't mind doing a little research on my own, but I can't
seem to nail down exactly what keywords I need to search for in the
first place!

Any pointers or examples would be greatly appreciated.


Look up 'mod_rewrite' for the Apache implementation of this sort of rewriting.

e.g. for a format of /archives/2004/04/03/ you may have a rewrite rule such as
(except all on one line):

RewriteRule /archives/([0-9]+)/([0-9]+)/([0-9]+)/
/articles.php?year=$1&month=$2&day=$3

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Hoagland | last post by:
I've got a scenario with a web application where I must access the virtual directory being accessed from within the Application_OnStart event handler. Specifically, I have a series of IIS virtual...
5
by: George Hester | last post by:
If I have 1 Virtual Dirctory with 2 different subfolders are these 2 different folders different virtual folders? Or if I have 2 different Virtual Directories each containing a subfolder are these...
3
by: pleaseHelp | last post by:
To better manage our secure site we just separated the registration and checkout sections of our web into separate virtual directories. These new virtual directories are on the same server as the...
2
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the...
4
by: Michelle | last post by:
I have a website with 6 virtual directories under it who dont "see" the bin/ directory in the root. If I create a /bin directory in each virtual directory and then copy my dll's in there, it...
1
by: Mark | last post by:
In our root web site, we have roughly 100 folders. 10 of these are virtual directories. The other 90 folders are a mix - some contain static HTML content. Others contain subfolders and...
4
by: Chuck P | last post by:
Using vs05 and making an asp.net 2.0 website. We use VSS and have everything organized like this SolutionName Documents Code WebProjectName1 WebServiceProjectName1
2
by: Angelo Cook | last post by:
how do you prevent the publishing of virtual directories in VS 2005. I have been using VS2003 and developing websites for years. I have been using virtual directories for images, icons, styles...
4
by: Paul F | last post by:
Im confused about the difference(s) between virtual directories and physical directories in IIS. Any ideas? *** Sent via Developersdex http://www.developersdex.com ***
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: 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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.