Support

Admin Tools

#24180 How to add correct 301 redirect to specific page

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Wednesday, 13 January 2016 04:06 CST

WoodyF4u
For a website I have added a Domainpointer in Direct Admin of the domain "kindcentrumschalkhaar.nl"
When a visitor is browsing to "springintveld.nl" he must be redirected to this specific page: "kindcentrumschalkhaar.nl/peuteropvang"

So I have added this code in "Custom .htaccess rules at the bottom of the file" of the htaccess-maker:
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} ^springintveld.nl$ [OR]
RewriteCond %{HTTP_HOST} ^www.springintveld.nl$
RewriteRule ^/?$ “http://www.kindcentrumschalkhaar.nl/peuteropvang” [R=301,L]
</IfModule>

But the visitor is redirected to the mainpage of kindcentrumschalkhaar.nl
Can you help to add the correct redirect of can you explain me why AdminTools doesn't redirect as I wish it does?

FYI: My hoster answered me, that there is so many code in the htaccess file that it should be possible that an other code in that file is overruling the new redirect.
Best regards,
Wouter (WoodyF4u)

nicholas
Akeeba Staff
Manager
The code above means "if any visitor comes through springintveld.nl or www.springintveld.nl redirect them to the fixed URL address http://www.kindcentrumschalkhaar.nl/peuteropvang"

The question is what is the URL structure of the new site. I suppose that you just moved the site from www.springintveld.nl to www.kindcentrumschalkhaar.nl. In this case you need to do the following:
  • Remove your .htaccess code. It's not needed and it'll confuse things.
  • In the .htaccess Maker set "Redirect www and non-www addresses" to "Redirect non-www to www"
  • In the .htaccess Maker set "Redirect this (old) domain name to the new one" to
    www.springintveld.nl
  • Save and create .htaccess


If you have a different URL structure you must also use the URL Redirection feature of Admin Tools to redirect the relative old URLs to the new ones.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

WoodyF4u
Thanks for your reply.
Let me explain it a little bit more.
At springintveld.nl there was an old Joomla!site. That site is deleted. The domain is moved and set as Domainpointer in Direct Admin of kindcentrumschalkhaar.nl
For the organisation Sporing in t Veld, I have created a special part in kindcentrumschalkhaar.nl
So when a visitor is browsing to springintveld.nl, he must be redirected to : kindcentrumschalkhaar.nl/peuteropvang

I hope you understand what I mean.
Best regards,
Wouter (WoodyF4u)

nicholas
Akeeba Staff
Manager
I see. Your question is well outside the scope of our support. We can only provide support for our software, not Apache itself. I will give you a last reply that will hopefully get you to the right track and close the ticket.

Your solution wasn't all that bad, you just missed the Apache docs on RewriteRule http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule which read "In addition to plain text, the Substitution string can include [...] mapping-function calls (${mapname:key|default})" So, basically, off the top of my head, I'd start by trying
RewriteRule ^/(.*) http://www.kindcentrumschalkhaar.nl/peuteropvang/$1 [R=301,L]

It is like the eight example in Apache's documentation page I posted above. That said, if you want further support about Apache I suggest you ask a question at StackOverflow or an Apache forum.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!