Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 103994

Rewrite rules modify a web URL's appearance. This modification is called URL rewriting. Rewritten URLs (sometimes known as short, fancy URLs, search engine friendly - SEF URLs, or slugs) are used to provide shorter and more relevant-looking links to web pages. The technique adds a layer of abstraction between the files used to generate a web page and the URL that is presented to the outside world.

1 vote
2 answers
5k views

add_rewrite_rule - Page Slug from "/foo-bar/" to "/foo/bar/"

I need foo-bar to become foo/bar instead: //domain.com/foo-bar   »   //domain.com/foo/bar I'm rebuilding a website that is currently in a home-brew CMS. They have a few pages with children, but th …
H21's user avatar
  • 46
2 votes
Accepted

add_rewrite_rule - Page Slug from "/foo-bar/" to "/foo/bar/"

This rule is what I ended up with after finding this post: Understanding add_rewrite_rule add_rewrite_rule( '^foo/([^/]*)/?$', 'index.php?pagename=foo-$matches[1]', 'top' );
H21's user avatar
  • 46