Forum
Need help rewritng Author Urls
Hello,
I'm having som trouble rewriting urls for my authors my current rewrite code is below:
RewriteRule ^blog/([a-zA-Z0-9-/]+)/archive.php?s=$1$ /blog/archive.php?author=$1&page=$2 [L]
RewriteRule ^blog/([a-zA-Z0-9-/]+)/archive.php?s=$1$ /blog/archive.php?author=$1 [L]
Here's how it currently looks:
https://www.zurimagazine.com/blog/06/10/15/archive.php?author=zuri-magazine
and here's what i'd like:
https://www.zurimagazine.com/author/zuri-magazine
can anyone help?
Hi Drew,
It doesn't seem to be working, i'm starting to think i gave you the wrong information. My current .htaccess file is below:
Here's what a typical blog url looks like on my site:
https://zurimagazine.com/blog/11/10/15/help-which-essential-oil-do-i-use-on-my-natural-hair
So i'm guessing with the right line in my .htaccess file, the author link should look like this:
https://www.zurimagazine.com/blog/author/zuri-magazine
Ok, so:
Hi Drew,
The snippet you sent over didn't work so i done a little trial and error and got it doing something. My url now looks like this:
https://www.zurimagazine.com/blog/archive.php?author=zuri-magazine
using this line in my .htaccess:
Is there anyway I can get rid of:
with an end result of:
https://www.zurimagazine.com/blog/author/zuri-magazine
Remember the order of rewrite rules is important.
/blog/author
might match a pattern for/blog/some-post-slug
so make sure that more-specific rules come first.Hi Drew,
i've added the author code at the bottom of my file and still no luck
What happens?