I’m using a theme with no author template.
According to Author Templates,
In the case of authors, the hierarchy is fairly simple. The Template
Hierarchy specifies that WordPress uses the first Template file it
finds in your current Theme’s directory from the following list:
author-{nicename}.php - If the author's nice name were rami, WordPress would look for author-rami.php.
author-{id}.php - If the author's ID were 6, WordPress would look for author-6.php.
author.php
archive.php
index.php
That is, if you do not have an author.php file, WordPress will check
for archive.php, and so on.
Well, I created author.php
and author-username.php
file (for test) and put them in wp-content/themes/mytemplate/
.
But when I try mysite.com/author/username
WordPress redirects to index page.
I’m using Nginx as my web server.
According to your scenario: most likely a Plugin is doing the redirect from the author archive
page to the home
page.
For example: Yoast SEO Plugin is know to cause a similar issue. If you are using Yoast SEO Plugin, then Go to Yoast SEO
Menu from your WordPress admin panel & then:
Go to Titles & metas
=> Archives
Then uncheck Disable the author archives
if it is checked.
Then try the author link (clear browser cache if it doesn’t work immediately).
Disable the author archives
| Enable the author archives
option may also be in:
SEO Menu
=> Titles & metas
=> Others
(depending on your version of the plugin)
If it doesn’t work, then try disabling plugins one by one to find out which of the plugins is causing the redirect.
NOTE: Every time you disable a plugin to test if the redirect is still happening, take the following two steps to be sure:
-
Clear browser cache.
-
Clear WordPress Rewrite rules from:
Admin Menu
=> Settings
=> Permalinks
then click Save Changes
button without making any change from there.
Once you identify the problematic plugin, find if it has any option to enable / disable author archives & take action accordingly.