Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

How to redirect pages with php extension

Started by Samuele Masetto 9 years ago · 3 replies · 1049 views
9 years ago

I'm moving a old php site in Grav.
I'd like to point old ulrs to new pages.
I tried to use route aliases in new page like this:

YAML
routes:
  aliases:
      - '/congressi.php?id_evento=296'

but I have "Page not found".
Is it possibile to do it in Grav without to use .htaccess redirect?
Thanks

9 years ago

Another solution could be the full url to that page instead of the /... only, give that a go :)?

9 years ago

I'm pretty sure you'd have to do that outside Grav in your .htaccess or other server config file. A standard Grav server config will intercept *.php paths, so you'd need them to find your redirects before they reach Grav's settings. I'm 90% sure ;)

And congratulations on behalf of all web users for taking the trouble to redirect! :) Not even some of the giant wealthy sites like Google and Microsoft bother with this important step. I see dead links to their old URL schemes a lot, even from within their own sites.

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago