Skip to content
Advertisement

how to make an automatic redirect to 404 every $slug that is not in views [closed]

here is my code, i need to redirect every $slug that is not in views to 404 page automaticly

JavaScript

Advertisement

Answer

You can use

JavaScript

to check wheater the view exist or not

if not present you can use below snippet to redirect to 404

JavaScript

complete code:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement