Hi!, how can I rewrite this url:
../pages/owner/group:2533
to
../pages/group/2533/all
I´ve tried with
rewrite ^pages/owner/group:([0-9]+)$ /pages/group/$1/all last;
but dont works. Any sugestion??
I´ve Nginx and Elgg 1.8
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
You can try my URL fixer plugin: https://github.com/juho-jaakkola/elgg-url_fixer. It attempts to find and fix deprecated urls from the database.
I recommend testing it carefully in a test environment before using at a live site!
@Juho I´ve just try your plugin, but I don´t know how to configure it for my rewriting needs :(
If I remember correctly, it has already been configured to fix your use case.
It don´t work for me, when I click on "more pages" link, from the group pages widget, it goes to:
http://ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/pages/owner/group:1974
and the right url must be
http://ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/pages/group/1974/all
Did you actually run the fixing feature? It can be found in the admin panel from Administer > Utilities > URL Fixer.
I think it is running, to start it I only have to activate the plugin, are you?
This is the displaying page from Administer > Utilities > URL Fixer
Utilities : URL Fixer
Found 0 items
Congratulations! Deprecated urls were not found.
Ok, so I remembered wrong. It doesn't seem help with your use case.
Ok @Juho thank you. Anyone can help me with this issue please??
You can hook into the 'route', 'pages' plugin hook
Then inspect the return value for to see if it contains the parameters for the old url
If so, return the parameters for the new url - or forward to the new url
Where are the deprecated URLs? Are they within site content (e.g. links within a blog text etc.) or are there menu items on your site that forward to the wrong URL? In case of the latter I would guess that you use some plugin that has the deprecated URL in its code. Then I would update the code for the forwarding to work instead of using the 'route', 'pages' plugin hook because the hook will no longer be necessary if the code is correct.
If the wrong links are included in content, then the URLs are saved in the database entries of this content. The plugin hook would be possible to use then. But the correction of the database entries would make the plugin hook unneccesary, too. The plugin of Juho might not be able to correct the wrong urls in its present form but you could modify classes/UrlFixer.php for the URLs to be found and corrected.
- Previous
- 1
- 2
- Next
You must log in to post replies.