Custom Domain for Oracle APEX Apps — Clean URLs with PHP Redirect

APEX PHP Apache Hosting

Custom Domain for Oracle APEX Apps — Clean URLs for Your Customers with PHP Redirect

Instead of long APEX URLs, give your customers a clean domain. One PHP file does the rest.

📅 June 2026 👤 Sajjad Hanifa ⏱ ~5 min read 🏢 S&H Software Solutions

When you build an Oracle APEX application for a customer, the URL they get looks something like this:

URL
https://app.mysmart-invoice.com/ords/r/invoice_prod/invoice

That's not something you put on a business card. Customers don't want to remember technical paths, port numbers, or workspace names. They just want to type a domain and land in their application. The solution is surprisingly simple: one PHP file on any standard web hosting.

💡
Live example: mysmart-invoice.de and mysmart-invoice.com both redirect directly to the Oracle APEX invoice application — the customer only ever sees the clean domain.

How It Works

The idea is straightforward: you point a clean domain (like mysmart-invoice.de) to any standard web hosting that runs Apache + PHP. On that hosting, you place a single index.php file that immediately redirects the visitor to the real APEX URL. The customer never sees the long URL — they only ever interact with the clean domain.

Customer types mysmart-invoice.de in the browser
Apache serves index.php
PHP sends a redirect header to the APEX application URL
Browser loads the APEX app — customer sees their application

Step 01
1
Create the index.php
3 lines · works on any PHP hosting · no framework needed

Create a file called index.php with the following content. Replace the URL with your actual APEX application URL:

index.php
<?php
// The URL of your Oracle APEX application
$url = 'https://app.mysmart-invoice.com/ords/r/invoice_prod/invoice';

// Redirect the visitor
header('Location: ' . $url);

// Stop script execution
exit();
?>
💡
Why exit() after the header?
PHP continues executing code even after sending a Location header. The exit() call ensures the script stops immediately — nothing else runs, no content is sent to the browser.

Step 02
2
Upload to Web Hosting
FTP · cPanel File Manager · any standard hosting works

Upload the index.php to the root directory of your domain (usually public_html/ or httpdocs/). That's the only file you need — no CMS, no framework, no database.

Any shared hosting plan works (Hostinger, IONOS, Strato, etc.)
PHP 7+ is sufficient — this code works on any version
Cost: often less than €2/month per domain
SSL certificate: enable "Let's Encrypt" in cPanel for HTTPS

Step 03
3
Alternative: .htaccess Redirect
No PHP needed · Apache only · one line

If you prefer not to use PHP, you can achieve the same result with an .htaccess file. This works on Apache servers without any PHP dependency:

.htaccess
Redirect 301 / https://app.mysmart-invoice.com/ords/r/invoice_prod/invoice
⚠️
301 vs 302 — which should you use?
Use 301 (permanent redirect) if the APEX URL will never change — browsers and search engines cache this. Use 302 (temporary) if you might point the domain somewhere else later. For customer applications that are live long-term, 301 is the right choice.

One Customer = One Domain

The real power of this pattern: every customer gets their own domain, each pointing to their specific APEX application. The setup is the same every time — just change the URL in index.php.

Customer DomainAPEX Application
mysmart-invoice.deInvoice management app
mysmart-invoice.comSame app — international domain
portal.customer-b.deCustomer B's APEX portal
app.customer-c.comCustomer C's APEX dashboard

You can even cover multiple TLDs for the same customer (.de and .com) — each with their own index.php, both pointing to the same APEX URL. That's exactly how mysmart-invoice.de and mysmart-invoice.com work.

Result: Professional customer experience, zero complexity. The customer bookmarks a clean domain, you manage the APEX app behind it — and changing the APEX URL later is a one-line edit in index.php.

Final Thoughts

This is one of those solutions that takes 10 minutes to set up and looks completely professional. Customers never have to deal with ORDS paths, workspace names, or port numbers. They get a domain they recognize, and it just works.

We use this pattern for every customer delivery at S&H Software Solutions. The hosting cost is negligible, the setup is repeatable, and if we ever need to move the APEX application to a different server or URL — we update one file, and the customer never notices.

SH
Sajjad Hanifa
Software Developer · S&H Software Solutions · Oracle APEX, PHP, Apache
Oracle APEX PHP Apache Hosting Custom Domain ORDS Redirect .htaccess

 {fullWidth}

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post

نموذج الاتصال