logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: Working with clean URLs
Author
chrisguk



Joined: 27 Mar 2012
Posts: 2
Location: Germany

PostPosted: Thu 27 Dec '12 1:29    Post subject: Working with clean URLs Reply with quote

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: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 08 Jan '13 12:42    Post subject: Reply with quote

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


Reply to topic   Topic: Working with clean URLs View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner