Just found this forum, google groups htaccess forum is pretty useless, 73 members and no one uses it. :)
I am working on a website where users have the ability to add content in various pages. Posts, Assignments, Resources etc.
I am giving them the ability to name their space giving them a URL of http://server.domain.com/username/
Each of the pages would then follow the URL as http://server.domain.com/username/Posts etc.
I have the below cond/rewrite working.
- Code: Select all
# run correct page for each site_id
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9\-]*)/(.*)$ /pages/$2/index.php?site_id=$1 [QSA,L]
Where:
$2 = the page to show... /root/pages/Posts/index.php
$1 = the user site to load
My only problem now is when a visitor/user hits a specific post or a user needs to edit a specific post.
http://server.domain.com/username/Posts/1
I cannot get it to read the next value, it automatically assumes I'm trying to access a directory named Posts/1
I've tried
- Code: Select all
RewriteRule ^([a-zA-Z0-9\-]*)/(.*)$/([0-9]*)$ /pages/$2/index.php?site_id=$1&row=$3 [QSA,L]
With no success.
If you can help, I'd really appreciate it.