Title: Dynamic Page template
Last modified: August 18, 2016

---

# Dynamic Page template

 *  [pennywise83](https://wordpress.org/support/users/pennywise83/)
 * (@pennywise83)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/dynamic-page-templlate/)
 * Hi,
    I’ve a little problem with a page template.
 * I have a simple page template named “mypage.php” used in a page named “hello”.
   Here is the code:
 * <?php
    get_header(); echo “HI “.$_GET[‘username’]; get_footer(); ?>
 * If i go to [http://www.mydomain.com/hello?username=Pennywise](http://www.mydomain.com/hello?username=Pennywise)
   i get:
 * “Hi Pennywise!”
 * The problem reguarding the modrewrite.
 * I’ve created a rule in my .htaccess like this:
 * RewriteRule ^hello/([^/]+)$ hellousername=$1
 * Then if I go to [http://www.mydomain.com/hello/pennywise](http://www.mydomain.com/hello/pennywise)
   I receive a 404 error instead of the page showed by [http://www.mydomain.com/hello?username=Pennywise](http://www.mydomain.com/hello?username=Pennywise)
 * Anyone can help me? 🙁

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [pennywise83](https://wordpress.org/support/users/pennywise83/)
 * (@pennywise83)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/dynamic-page-templlate/#post-642782)
 * up…
 *  Thread Starter [pennywise83](https://wordpress.org/support/users/pennywise83/)
 * (@pennywise83)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/dynamic-page-templlate/#post-642947)
 * Up…
    I really need help here… anyone can help me? 🙁
 *  Thread Starter [pennywise83](https://wordpress.org/support/users/pennywise83/)
 * (@pennywise83)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/dynamic-page-templlate/#post-642948)
 * I’ve found several unanswered post like mine about this problem, nobody can help
   me? 🙁
 *  [malpass](https://wordpress.org/support/users/malpass/)
 * (@malpass)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/dynamic-page-templlate/#post-643004)
 * For one:
 * RewriteRule ^hello/([^/]+)$ hellousername=$1
 * needs to be
 * RewriteRule ^hello/([^/]+)$ username=$1
 * Second, you need to add:
 * RewriteEngine On
 * So the solution is:
 * RewriteEngine On
    RewriteRule ^hello/([^/]+)$ username=$1
 *  [malpass](https://wordpress.org/support/users/malpass/)
 * (@malpass)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/dynamic-page-templlate/#post-643005)
 * PS. How have you created a mypage.php file to load from WP? I wish to create 
   a homepage that shows latest news with a banner at the top. I edited index.php
   with a banner but it appears on everything. Also I tried adding php code to a
   WP Page post, but it just displays the php as text?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Dynamic Page template’ is closed to new replies.

## Tags

 * [mod-rewrite](https://wordpress.org/support/topic-tag/mod-rewrite/)
 * [page template](https://wordpress.org/support/topic-tag/page-template/)
 * [page.php](https://wordpress.org/support/topic-tag/page-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [malpass](https://wordpress.org/support/users/malpass/)
 * Last activity: [18 years, 2 months ago](https://wordpress.org/support/topic/dynamic-page-templlate/#post-643005)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
