.htaccess - URL rewrite rules with Apache -


i have .htaccess file this:

rewriteengine on  rewriterule ^([\w-]+)/([\w-]+)/?$ profile.php?username=$1&w=$2 [qsa,l] rewriterule ^([\w-]+)/?$ profile.php?username=$1 [qsa,l] rewriterule ^p/timeline timeline.php [nc,l] rewriterule ^p/notifications notifications.php [nc,l] 

i can use url this

www.mysite.com/username or www.mysite.com/username/photos 

but rules not work. example:

www.mysite.com/p/timeline 

there problem url include mysite.com/p/..

anyone can me?

you should first parse rules p/timeline , p/notification. ordering of rules important.

rewriteengine on  rewriterule ^p/(notifications|timeline) $1.php [nc,l] rewriterule ^([\w-]+)/([\w-]+)/?$ profile.php?username=$1&w=$2 [qsa,l] rewriterule ^([\w-]+)/?$ profile.php?username=$1 [qsa,l] 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -