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

Change Pretty URLs to Ugly URL?

Started by Muut Archive 11 years ago · 5 replies · 575 views
11 years ago

Hiya! Is it possible to change the url structure for example from /page-name/ to /page-name.html ? And for subpages /main-page/subpage.html
I want to migrate an old existing site with good google-rankings and don't want to change anything regarding the URLs. Also I don't want to start a debate about the sense of using legacy URLs again :-)) So, is this possible? Thanks!

11 years ago

You can add in Slugs to your md file to change that.

A better solution would be to 301 redirect the old url's to the new ones (server level/htacess). Google will honour the 301 redirect and several days later old listing will disappear and new one will appear (with seo / page rank moved to the new location).

11 years ago

BTW, what you asking for is already there. Grav supports filename extensions, but as the default is .html this is optional. So

TXT
/some-page

and

TXT
/some-page.html

will display the same page.

11 years ago

Hi. So you mean it doesn't matter when I go live with the site? I would not need to do 301 redirects in my case? If so...how do I set this up? If I type the page URL with .html I get "The requested resource /mypage.html was not found on this server."

11 years ago

FYI, this probably will not work on aliases you have configured in site.yaml, this is for actual pages only.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1327 9 years ago
Archive · by Muut Archive, 9 years ago
2 921 9 years ago
Archive · by Muut Archive, 9 years ago
2 4050 9 years ago
Archive · by Muut Archive, 9 years ago
1 2928 9 years ago
Archive · by Muut Archive, 9 years ago
3 1107 9 years ago