Masking Urls

Melody Scott
Melody Scott used Ask the Experts™
on
Hi, I am running techgardens.com/optical-engineering.

My client is creating pages at techgardens.com/optical-engineering/ciena, techgardens.com/optical-engineering/Infinera, techgardens.com/optical-engineering/Coriant, techgardens.com/optical-engineering/BTI, techgardens.com/optical-engineering/JDSU.

She would like, when someone clicks on a link for one of those pages, that they see the page, but the url reads  techgardens.com/optical-engineering/.

I think I can do this with htaccess, but need some help. The WP htaccess already has this:

# BEGIN WordPress
AddHandler application/x-httpd-php70 .php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /optical-engineering/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /optical-engineering/index.php [L]
</IfModule>

Can I alter that to read:

# BEGIN WordPress
AddHandler application/x-httpd-php70 .php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /optical-engineering/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /optical-engineering/index.php [L]
RewriteRule ^ciena/?$ /
RewriteRule ^Infinera/?$ /
RewriteRule ^Coriant/?$ /
RewriteRule ^BTI/?$ /
RewriteRule ^JDSU/?$ /
</IfModule>

And will that give me the result we want? Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Consultant & Challenge Subduer
Top Expert 2009
Commented:
You would need to use AJAX (or an iframe) to do that. But why hide good URLs? Sometimes it's the responsibility of a good web designer/developer to talk clients out of doing things that aren't beneficial to the client's customers.

Author

Commented:
It's our marketer asking for it, she's pretty solid in knowing what she wants.

Author

Commented:
This article seems to indicate I can do it with htaccess: https://www.interserver.net/tips/kb/how-to-do-url-masking/
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

David S.Consultant & Challenge Subduer
Top Expert 2009

Commented:
That's a 1-to-1 relationship. You're trying to do a 1-to-many.

Author

Commented:
Gotcha, thanks. I'm not sure how the iframe would work. I would want the home page to still show, so I couldn't have an iframe in that page.

Maybe we can't do this.

Author

Commented:
thanks for your help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial