Skip to content

Fix domain level redirects

Vishal Tak requested to merge fix-redirects into master

What does this MR do?

Browsing \google.com automatically resolves it to google.com. Thus, adding a /\domain.name.com in _redirects file would redirect to domain.name.com. We do not allow domain-level redirects at all. This MR fixes that.


Steps to verify the change

  1. Add a _redirects file to the public folder of a plain-html pages repo.
/test-boo/test1.html /test-boo/index.html 301
/test-boo/test2.html /test-boo/index.html 302
/test-boo/test3.html /test-boo/boo.html 301
/test-boo/test4.html /test-boo/boo.html 302
/test-boo/test5.html /test-boo/index.html 301
/test-boo/test6.html /test-boo/index.html 302
/test-boo/test7.html /test-boo/boo.html 301
/test-boo/test8.html /test-boo/boo.html 302
/test-boo/test9.html /\www.google.com 301
/test-boo/test10.html /\www.google.com 302
  1. Start Pages server and browse http://your-group.pages.gdk.test:3010/your-project/_redirects
  2. Validate that it is showing the last 2 rules as invalid

image


TODO

Edited by Vishal Tak

Merge request reports