Jump to content
apeisa

Release: Redirects

Recommended Posts

Hmm... strange. I am running almost latest version of P21 and ProcessRedirects without any problems. Have you tried uninstalling and installing again? Can you show me screenshot of redirects page (or if you are willing provide me with login credentials for a day or two that I can go and check what is wrong?).

EDIT: Also what is template in your /processwire/setup/redirects/ page? I assume it is admin and then Process is "processRedirects" since otherwise you shouldn't be able to add new redirects. But just in case.

Share this post


Link to post
Share on other sites

apeisa, I got a process module "Image editor" that leads me to this thread :D seems like that is from your crop images module?

Share this post


Link to post
Share on other sites

when I enter some urls like

"/de/finanz/finanzberichte.aspx"

and when I click on it to edit, it says:  Error found in field 'redirect_from' - please check that it is a valid URL

It is valid and for some reason this doesn't show error (huh?):

"/de/corporate_governance/corporate_governance.aspx"

Some work some don't.

But on frontend they all don't seem to redirect ... ?

---

ok sorted it out , it'w working on the frontend now, I had urlsegments enabled on the root template for the "/" . So it didn't work, can you reproduce this?

The error is still shown on admin for some links. But can't see whats wrong. May todo with the .aspx bein evil? :)

Share this post


Link to post
Share on other sites

Thanks Soma, I will look into this at the evening or at the weekend.

Share this post


Link to post
Share on other sites

I love this, it makes 301 redirects really simple. I seem to have found another URL scheme it doesn't support yet, though.

"Incoming" URL is /index.php?/pages/bfs_ka.html – when I edit the redirect, it reports an invalid URL in redirect_from.

Share this post


Link to post
Share on other sites
"Incoming" URL is /index.php?/pages/bfs_ka.html – when I edit the redirect, it reports an invalid URL in redirect_from.

Is that a valid URL? I'm not sure a variable name in a URL can have a slash in it, but I could be wrong. However, I don't think that the Redirects module will get the opportunity to ever see that URL. /index.php is a file that already exists (ProcessWire's /index.php). So requesting it directly sidesteps the whole Apache rewrite engine which maps non-existing file requests to ProcessWire. I think that the only way you could setup a redirect for a URL like this is by using Apache Rewrite rules in your .htaccess file.

Share this post


Link to post
Share on other sites

Is that a valid URL?

Well, at least the blog system which was used before on this site uses URLs like this (if you don't use mod_rewrite). And they work. :)

Okay, so I'll have to use mod_rewrite for that after all. Thanks, Ryan.

Share this post


Link to post
Share on other sites

If you've got a lot of URLs to deal with, you don't have to create separate redirects for each of them in your .htaccess if you don't want to. You could automate it. Setup a rewrite rule for "index.php?/" and redirect all of them to another directory where the old blog is, your own PHP script, or into ProcessWire (where you could let the Redirects module handle them). Let me know if I can be of assistance with the RewriteRule.

Share this post


Link to post
Share on other sites

Thanks, but I got it covered. :) There are just 5 urls with a %{QUERY_STRING}, that's perfectly okay to write manually rewrite rules for in my book.

Share this post


Link to post
Share on other sites

@ Antii,

Your module append the styles (ProcessRedirects.css?v=100) to the $config->styles when working in templates (front-end) also.

Maybee it's better to check if you're in the admin & then append the style.

For now "$config->styles->remove('/site/modules/ProcessRedirects/ProcessRedirects.css?v=100');" solves this 'issue'

BTW, I love your module..

Share this post


Link to post
Share on other sites

Thanks for the report Martijn. This has been on TODO list way too long, will fix it now!

Share this post


Link to post
Share on other sites

I've just added some redirects and noticed a few things:

1. The bulk import only seems to add the first one in the list. I was entering them in the filed like this: page1.php, page2.php, page3.php etc

2. If I edit any exiting redirect I get this error, but the redirect does work.


redirect_from: Error found - please check that it is a valid URL (redirect_from)

Share this post


Link to post
Share on other sites

Hi Antti

I knew this module existed but was looking for it in the modules section or on modules manager - could you add it please?

It's perfect for a site I'm about to launch to map a few stray URLs :)

Share this post


Link to post
Share on other sites

Apeisa, you just develop the best modules :D Unfortunately this module does not work when used together with your Multisite-Module.

Is it possible to modify it so that these two work together? I tried to understand the code, but obviously I am a absolute beginner when it comes to PHP....

Share this post


Link to post
Share on other sites

Thanks for the kind words ezeey! Nothing works with multisite :)

I hope to find some time this weekend to take a look. If you can provide any more information it would definitely help (how to reproduce, test site I can login etc).

  • Like 3

Share this post


Link to post
Share on other sites

Besides PW being an amazing cms there are some amazing contributing coders here as well. I am loosing track of all the modules, tips and tricks coming out lately. Wished I could spend more time on PW but damn my job doesn't allow me.

  • Like 1

Share this post


Link to post
Share on other sites

1. The bulk import only seems to add the first one in the list. I was entering them in the filed like this: page1.php, page2.php, page3.php etc

2. If I edit any exiting redirect I get this error, but the redirect does work.

I just used the Redirects module a couple weeks ago (for cmscritic.com) and imported a hundred or so redirects from a CSV. I haven't run into either of these issues. You might want to double check that the CSV you imported from has proper linebreaks?

Share this post


Link to post
Share on other sites

Hi, I have a funny problem with redirects.

I want to redirect from

/en/index.php   (which was a valid link on the website before the update to PW)

to

/en/

Works perfectly. 

But if I open the redirect settings for editing, the"from" link is empty and I get a warning "enter valid url".

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...