Problem with redirect pages containing index.php?
PermalinkI tried to redirect pages from the old installation of a website
like:
"mywebsite.com/index.php?page=contact"
to the page:
"mywebsite.com/en/contact"
inside the "Location" panel of a page.
That don't works - it always redirects to the front page:
"mywebsite.com/en"
I think all pages with an /index.php? will be redirected to the start page. I tried without internationalization and with 5.7.5RC1
Any Idea how to solve this - is it a bug (using 5.7.4.2)?
Best,
Torsten
I didn't changed things in .htaccess file:
# -- concrete5 urls start -- <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.html !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f RewriteRule . index.php [L] </IfModule> # -- concrete5 urls end --
I tried it with pretty URLs turned off and removed the .htaccess file - same result: redirects to start page.
The URL redirects (301) - but not to this page (in this case "contact") - it redirects to the start page.
Lets say the old installation had a page with the URL:
"mypage.com/contactpage"
I can redirect it to the new page called:
"mypage.com/contact"
within the page "Location" panel adding a URL called:
"/contactpage"
this redirects to my new page called "contact".
But not if "index.php?" is inside the old url
That approach won't work, index.php is a page and ?page=contact is nothing but a parameter to a page and won't be considered as an URI.
You'll either have to use an add-on like URL director which doesn't exist for 5.7 or create a custom .htaccess file to redirect those addresses..
Even if ?page=contact is just an parameter - its an URL that will be redirected by the concrete5 redirection function - but wrong.
I think this often happens when relaunching a website (old site: index.php?=contact - new site: pretty URLs) and I thought this function is for such kind of redirects. I don't think this is a very special case.
Shouldn't it be part of this function?
We only ever use this function when we move pages in concrete5 around, never to handle redirects, that's not the intent of this function.
I need to find another solution.
Thanks a lot Remo :-)
I'd assume -f causes the problem because index.php is an actual file that exists on your new site..