ivinteractive / kirbycms-redirects

GNU General Public License v3.0
33 stars 3 forks source link

Edit redirects page gives an error #12

Open introvert opened 7 years ago

introvert commented 7 years ago

Hey,

The panel admin seems to be fixed now. However, when I click edit on the redirects page, I get a 404 error:

Page not found: http://localhost:8888/panel/pages/redirects/edit

The problem is because I'm running my blog in a subfolder on a local machine.

Also, if I go to http://localhost:8888/blog/panel/pages/redirects/edit, I get the following error:

The page could not be found

Also, it doesn't seem that a blueprint redirects would be created automatically - should I create it manually?

ivi-admin commented 7 years ago

Sorry for closing the previous issue prematurely! The path for the redirects page should now work independently of the folder path of the Kirby installation (fixed here).

Have you created the redirects page yet? By default the plugin loads a blueprint (at assets/blueprints/redirects.yaml), though you can substitute the blueprint by using the c::get('redirecty-template') in the config. The actual content page does need to be created manually, though.

introvert commented 7 years ago

This now works, but I'm getting another problem: when I add redirects, they won't be executed (I added the redirecty call in the header snippet). Could it be because my blog is located in a subfolder: website.com/blog ?

introvert commented 7 years ago

Here's also var_dump from $redirects in the redirecty() function:

         | [0]=>
        | object(Structure)#166 (3) {
        | ["old"]=>
       | object(Field)#167 (3) {
       | ["page"]=>
       | string(9) "redirects"
       | ["key"]=>
       | string(3) "old"
       | ["value"]=>
       | string(9) "new-url"
       | }
       | ["new"]=>
       | object(Field)#168 (3) {
       | ["page"]=>
       | string(9) "redirects"
       | ["key"]=>
       | string(3) "new"
       | ["value"]=>
       | string(4) "kaki"
       | }
       | ["external"]=>
       | object(Field)#169 (3) {
       | ["page"]=>
       | string(9) "redirects"
       | ["key"]=>
       | string(8) "external"
       | ["value"]=>
       | string(1) "0"
       | }
       | }
       | }