MODX Community

Redirect using PHP

I’m in a weird situation where I don’t have an access to admin panel, only to the website files, and I haven’t worked with MODX at all. What file should I edit to add a PHP redirect within the website? And what if I want to redirect from a particular page to another particular page?

If you want to redirect immediately from an existing page A to another page B, you simply change the type of that resource from Document to Weblink and put the destination page ID as the target. This automatically creates a 301 redirect.

If you don’t even have access to the manager you’ll need to edit .htaccess in the web root and use rewrite rules to match and redirect whatever URLs you need. Assuming it’s an Apache server. If it’s Nginx the procedure is different but I think the same concept applies.

1 Like