Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Working with clean URLs |
|
Author |
|
chrisguk
Joined: 27 Mar 2012 Posts: 2 Location: Germany
|
Posted: Thu 27 Dec '12 1:29 Post subject: Working with clean URLs |
|
|
Hi,
I have read numerous posts in this forum regarding clean URLs but its either I am not understanding or none of the posts relate to my situation.
First my code .htaccess:
Code: |
RewriteRule ^(([^/]+/)*[^/.]+)$ index.php?page=$1 [L]
|
My folder structure:
Content - this folder contains all of the called pages
index.php - all pages are called into this file using GET
The result of the above in URLs is a follows:
http://www.example.com/about
The problem I have is when I want to call a second level for example:
http://www.example.com/about/profiles
So just to recap all of the physical files are located in the Folder "content", though I believe from what I have been reading this is irrelevant.
Or do I have to create separate folders for each?
Primarily this is a mod_rewrite question so any help would be great |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 08 Jan '13 12:42 Post subject: |
|
|
Easiest way it to push everything that does not exist through your file
Code: |
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1
|
|
|
Back to top |
|
|
|
|
|
|