我的意思是,所以可以说我有用户自身的页面:localhost/blog/profile/ImUser1
创建跟进页面为用户
我想有像用户的其他网页: localhost/blog/profile/ImUser1/my_subscribers
或者 localhost/blog/profile/ImUser1/my_posts
如何创建那些类型的页面,如订阅者页面?
我当前的.htaccess代码:
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]
这允许我去的userpage。而且我需要在URL,因为这就是我如何提取谁订阅了他们的信息的用户名。
这里是我的结构我的PHP至今:
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';
}
我如何调整我的PHP和的.htaccess,使其工作?
检查了这一点:http://stackoverflow.com/questions/7930849/php-url-rewrite – 2013-04-08 18:26:05