i want when any user type a mar.com/work.php it aces the page but url is showing mar.com/

Why don't you save work.php as index.php ?

Member Avatar
diafol

have you got a redirect or a .htaccess file set up? Are you using a php framework?

work.php is file in webdirectory no i do not want any redirect i want to hide my complete url

Member Avatar
diafol

OK, now I get it. Apache rewrite rules in .htaccess is probably what you're looking for. Thing is, if you just type in the base url (www.example.com), how will your site know which page to serve if you set all your pages to that?

People usually route all their page requests though the index.php file and 'prettify' their urls to virtual folders, e.g.

www.example.com/index.php?page=work will become www.example.com/work/

However trying to do this:

www.example.com/work.php => www.example.com
www.example.com/about.php => www.example.com
www.example.com/another.php => www.example.com

Will cause confusion. Imagine you bookmarked www.example.com - where should it go? SEO would be another issue. Something to avoid.