Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

How to redirect pages with php extension

Started by Samuele Masetto 8 years ago · 3 replies · 655 views
8 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

8 years ago

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

8 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 Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago