What I mean by that is, so lets say I have a page for the user itself: localhost/blog/profile/ImUser1
I want to have other pages for the user like: localhost/blog/profile/ImUser1/my_subscribers Or localhost/blog/profile/ImUser1/my_posts
How do I create those kind of pages, like the subscriber page?
My current .htaccess code:
RewriteEngine On CheckCaseOnly On CheckSpelling On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^profile/(.*)$ /blog/profile.php?username=$1 [QSA,L] This allows for me to get to the userpage. And I need to have the username in the URL because thats how I extract information of who is subscribed to them.
Here is how I structured my PHP so far:
if(isset($_GET['username']) === true && empty($_GET['username']) === false){ $username = $_GET['username']; if(user_exists($username) === true){ echo 'Welcome to '.$username.' page!'; } }else{ echo 'Please enter a username in the URL'; } How do I tweak my PHP and .htaccess to make it work?