Apache Lounge


About Forum Index Downloads Search Register Log in  RSS Apache Lounge  

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.

Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: catch-all error handling & ad-page workaround

Joined: 10 Apr 2020
Posts: 1
Location: Dubai

PostPosted: Fri 10 Apr '20 16:31    Post subject: catch-all error handling & ad-page workaround Reply with quote


really hoping you’re all AOK while locked-in.
a rather simple apache virgin's question… surely the answer is very simple and I’ve done something silly; easy-step by step guidance is appreciated since, if this indeed means adding lines to .htaccess this would be my very first time and i don’t want to break anything/site downtime!!

and the answer won’t just help me, i’m sure lot of novices to web development like me could really appreciate help with this issue (i did a bit of searching this forum and didn’t succeed finding it covered).


What does one need to paste as script in .htaccess (and are there any other changes to be made to the FTP publishing settings of a sitebuilder or DNS panel) to have all errors just redirect visitors back to the homepage of one's site…. and in so doing, completely bypass their webhost’s ad-serving error-handling page? Or am I asking the wrong question and the solution just replacing their webhost’s with one’s own error handling page… in which case where is that and how to pull it off?
Just need the fastest workaround to defeat a webhost’s taking advantage of your Apache server’s pre-config to serve ads on your errors.

IF you need more details of my specific case, here they are:



If someone goes to my homepage from a browser, all the links to pages in it work fine when navigating within the site. Unfortunately, if i try to return to an old page through the URL bar or history, some browsers are automatically adding a “/“ at the end of the page URL, and this leads to my webhost’s handler page full of Ads that aren’t mine.

Can you guys please help get me out of this mess regardless of who’s responsible (my sitebuilder, webhost, or domain registrant)? I don’t want any ads to appear for my visitors … if a browser re-forms an URL ending in nothing to go to the same link but adding “/“ at the end it should still just go to the original corresponding same-URLed page but without the “/“ that would take it to my webhost’s error ads page. And if there are any other 404 errors it should just take people back to the index page — or for other errors plain-old default Apache error pages. With my webhost’s console I can create a folder in my webspace and change the destination folder in my sitebuilder to publish to, i can change DNS settings from the my webhost's control panel who manages my domain, I can copy-paste any scripting to put in the .htaccess page manually and control my allocated apache webspace. What I still don’t know how to do is script things myself.


0. Environment: Mobirise sitebuilder-made site that I publish using it as SFTP to IONOS 1and1 as my webhost who is Apache based (I don’t know the versions or OS they use). The domain itself I purchased from Namesilo, but when buying webhosting from 1and1 I agreed to have them manage my external domain using their panel for a seamless connection/configuration experience based on their extreme recommendation.
1. Example mobirise page that works fine : https://www.kx2.vision/kx2-researchstudies.html
2. Example mobirise page that is undesirably redirecting to IONOS ads : https://www.kx2.vision/kx2-researchstudies.html/
3. Ionos information page linked to from their Ads page: https://adimg.uimserv.net/1und1/Werbemittel/IONOS/us_defaultpage.html
4. Ionos webspace FTP Host: access810692252.webspace-data.io Port 22 . Mobirise is currently set to publish to [root] folder
5. 3 current lines in the .htaccess file : RewriteEngine On , RewriteCond %{HTTPS} off, RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
6. Current DNS settingsI see in the IONOS 1and1 panel:
    CNAME _domainconnect _domainconnect.1and1.com
    Domain Connect MX @ mx00.ionos.com Mail
    MX @ mx01.ionos.com Mail
    CNAME autodiscover adsredir.ionos.info Mail
    A @ Webhosting
    A www Webhosting

7. Nameservers: set to IONOS.
8. Misbehaving browser that adds the “/“ when pulling up results in URL bar for past pages: Safari on Mac — or its integration with Google for fetching most likely results
9. Strangely, despite my website already working with my domain pointing to it, messages in the IONOS 1&1 domain management console:
    Type-External domain
    Destination- Domain not in use (they then have an option to click Use your Domain, which among onward options is “Connect to a directory in your webspace’ or ‘Create and edit DNS records/Name server’. If I press 'Connect to a directory in your webspace’ it appears already default saved as “/“ (root) which is where I set my sitebuilder to publish my site)


( I contacted IONOS Support and after 3 days with several agents they say they added some script for me to .htaccess but fixing this isn’t in their scope… my web developer has to configure .Htaccess and/or move the location of my published page from the Root folder to a subfolder. I don’t know how to script things like this. I suspected that despite the good intent of their support reps IONOS is either deceitful or incompetent or both because I think that one CAN fix this from their DNS panel for my domain, and I had initially followed their instructions verbatim in the FTP documentation to publish to, there was nothing about root vs subfolders ------and I don’t THINK the problem is root vs subfolder because I have a friend who also uses my same sitebuilder Mobirise and publishes to Root with no problems, he says IONOS sets .htaccess for root. But IONOS tells me Apache config is beyond them, and meanwhile continue serving ads whenever there is anything out of the ordinary. I think IONOS 1&1 is meh-okay for advanced web developers given their cheap and reliable 1$/mo hosting, I would NOT recommend them though for amateur/front-end-only designers like me because their online chat/phone support experience is horrible, even their reps struggle with chats ending abruptly disconnected repeatedly saying 'Support agent has ended the chat' even though they haven't because of a 2-minute window timeout, I feel sorry for their support reps who are given such bad tools to help customers)

They don’t host any user forums and their support has absolved themselves of helping me further with this which is disappointing… but it is what it is , I suppose I can fix it myself with the Apache .htaccess ultimately with your help. I think IONOS didn't help me with this because they’re doing Godaddy tactics to make money off their hosting base (I guess that’s how their company can afford to give out $1 hosting)-- they’re making money from ad-serving on the sites of less-experienced users by obscuring the ability to configure their hosting experience easily, but maybe the grass isn’t greener everywhere else… I guess there's no avoiding my putting time to learn more about Apache myself as a self-website designer Smile
Back to top

Reply to topic   Topic: catch-all error handling & ad-page workaround View previous topic :: View next topic
Post new topic   Forum Index -> Apache