routes icon indicating copy to clipboard operation
routes copied to clipboard

Image instead of the page

Open peterkracik opened this issue 6 years ago • 3 comments

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()

peterkracik avatar Sep 27 '18 14:09 peterkracik

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?

jarednova avatar Sep 27 '18 14:09 jarednova

... 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?

jarednova avatar Sep 27 '18 14:09 jarednova

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?

vinkla avatar Oct 25 '21 12:10 vinkla