routes
routes copied to clipboard
Image instead of the page
I'm having trouble with certain links.
if the url contains same word as an image within wordpress media, the router will redirect me to the image url.
for example: the link mysite.com/category/books/ where "books" is a slug of the category, it should redirect me to the detail page of the category. except there is an image "Books.jpg" within the wp media, in that case it will redirect me to the mysite.com/wp-content/uploads/2018/09/Books.jpg.
as soon as I remove or rename the image, it works as it supposes to.
if I debug variables, everything's fine before the call Routes::load()
Thanks @hatto! Let's keep the conversation here. Have you set-up custom links using the router, or are you saying that normal WP paths (like mysite.com/category/books/) are not working properly in their "default" WordPress state even w/o any custom pieces from you?
... if you have any custom PHP that's calling Router can you post a gist so I can see if I can re-create the issue?
I know this is old but we have experience this issue. We have a route called archive/online
which WordPress routed to an attachment file called online.jpg
. We removed the image in order to make it work. Is there a way to prioritize the routes before WordPress custom routing?