Skip to main content
4 of 4
added 299 characters in body
David B
  • 193
  • 1
  • 1
  • 5

Wordpress Rewrite Rule

I have a standard page setup at http://mysite.com/mypage/

I'd like to setup a rewrite rule in my theme functions that takes any URLs such as:

http://mysite.com/mypage/helloworld/ <-- Currently shows "Not Found"

And translates it into:

http://mysite.com/mypage/?var=helloworld <-- Currently shows the standard page

NOTE ADDED:

"helloworld" is an unknown variable value, so I want ALL "/mypage/" urls to rewrite back, for example: http://mysite.com/mypage/abc/ http://mysite.com/mypage/1231241/ http://mysite.com/mypage/sdfasfdadsf/

Will all rewrite back to http://mysite.com/mypage/?var={path}

David B
  • 193
  • 1
  • 1
  • 5