Skip to content
Advertisement

Add parent to url (PHP)

So my boss asked me to modify some urls of our page like so:

What we have -> www.domain.com/finaPage

What he wants -> www.domain.com/parent/finalPage

I tried creating a directory named ‘parent’ and accesing the pages from there and it worked fine. The problem is that we alredy have a page named ‘parent’ that broke when I created the folder with the same name on the same directory.

So I can either have the urls ok and the parent page broken… or I can have the parent page ok but the urls wrong.

Somebody knows how can I fix this?

Web is fully made with PHP

Advertisement

Answer

Your can move your parent web page to a newly created parent folder and rename it to index.php

parent/index.php

so, when someone visit www.domain.com/parent it will show the renamed index.php file

and just put your finalpage in parent folder

parent/finalpage.php

So, when someone visit www.domain.com//finalPage it will show above page

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement