Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
4 added 366 characters in body
source | link

EDIT 2

To use pretty permalinks, such as example.com/account/john you need to activate in your admin area, in the permalink settings, and activate it on you server. You told us in comments that you used nginx, I know better apache so here is a tutorial which could help you.

https://www.cyberciti.biz/faq/how-to-configure-nginx-for-wordpress-permalinks/

EDIT

I went too fast, forget about my suggestion of add_rewrite_rule, I think that with using add_rewrite_endpoint you have to use the "template_redirect" hook instead of the "template_include" one.

END EDIT

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

EDIT

I went too fast, forget about my suggestion of add_rewrite_rule, I think that with using add_rewrite_endpoint you have to use the "template_redirect" hook instead of the "template_include" one.

END EDIT

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

EDIT 2

To use pretty permalinks, such as example.com/account/john you need to activate in your admin area, in the permalink settings, and activate it on you server. You told us in comments that you used nginx, I know better apache so here is a tutorial which could help you.

https://www.cyberciti.biz/faq/how-to-configure-nginx-for-wordpress-permalinks/

EDIT

I went too fast, forget about my suggestion of add_rewrite_rule, I think that with using add_rewrite_endpoint you have to use the "template_redirect" hook instead of the "template_include" one.

END EDIT

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

3 added 226 characters in body
source | link

EDIT

I went too fast, forget about my suggestion of add_rewrite_rule, I think that with using add_rewrite_endpoint you have to use the "template_redirect" hook instead of the "template_include" one.

END EDIT

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

EDIT

I went too fast, forget about my suggestion of add_rewrite_rule, I think that with using add_rewrite_endpoint you have to use the "template_redirect" hook instead of the "template_include" one.

END EDIT

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

2 added 395 characters in body
source | link

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

According to the code you show, I would add this to your account_page_endpoint function

add_rewrite_rule('^account/([a-z0-9]+)/?', 'index.php?account=$matches[1]', 'top');

It does not modify the .htaccess file, however you can refresh the rules.

You may need to refresh the rules after this modification.

Two possibilities:

-either you add, right after the line of code above, the call to the flush rewrite function like this:

flush_rewrite_rules();

-or you can go in you admin area, in the permalink settings and re save your current settings.

1
source | link