The solution can be something like:
1. add a rewrite rule(should be something like "^/([^/])/?" =>
"author=$matches[1]" ) with a high priority(so that it is before the WP
default rewrite rules).
2. Hook on parse_request action hook and see if it's a request for an
author page.
3. Check if author exists - if they do, do nothing. If the don't:
4. Check if verbose_page_rules is
true($wp_rewrite->use_verbose_page_rules). If it is - see if a page with
that slug exists.
5. Otherwise see if the request is for a post and if not, check for a page
with that slug.
You would need to dig into /wp-includes/rewrite.php in order to get a
better understanding of how the WordPress rewrite internals work.
Post by Chris Williams1) Build a test copy of the current setup on a local machine
2) Change the rewrite rules.
3) Write some new test posts to be sure the rules are the way you want
them.
4) Change the existing posts (as I suggested)
5) Test to make sure that you can see the old posts (and pages) via the
new rewrite rules.
6) Upload this test system to the live system.
But whatever, throwing your hands up and just forgetting the whole thing,
as you suggest, is also an option...
Post by Marko HeijnenThis are rewrite rules and can’t be added in MySQL since they will be
regenerated. I would not recommend doing this unless you are knowing what
you do. What isn’t the case here.
What you need to do is adjusting the rewrite rules for users but you need
to do more. You also need to validate that pages (maybe posts too) don’t
conflict with those.
So what you can do is rewrite those too but without the use case it’s
hard to see what the right approach is.
Best,
Marko
Post by Chris WilliamsShould be able to use a MySQL utility to do some kind of search/replace.
Perhaps export to a .SQL file, use a text editor to remove the desired
text, and reimport it.
Post by SinanAny solution ?
Post by SinanHello
What is the best way to do
this
*example.com/author/username <http://example.com/author/username>*
into this
*example.com/username <http://example.com/username>*
--
Sinan İŞLER
sinanisler.com <http://www.sinanisler.com/>
--
Sinan İŞLER
sinanisler.com <http://www.sinanisler.com/>
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers