Filter/delete only root domains?

Not near my laptop to test this out at the moment, but write a 2 minute PHP script using parse_url and you are good to go.

If you haven't sorted it in an hour or so drop me a PM and I will crank one out for you.

FB
 
Infact give something like the below a whirl - should work and only print out the urls:

Code:
<?php

        $domains = file("domains"); //change this to the name of your list of domains

        foreach($domains as $d)
        {
                if(parse_url(trim($d), PHP_URL_PATH))
                {
                        print $d;
                }
        }

?>


If you run this like:

Code:
php scriptname.php > list.txt

it will spit all the non-root domains to list.txt
 
Last edited:
All domains and pages are displayed. Not working for me.
 
Mmmm, worked fine for me - see attached pics.
 

Attachments

  • 1.png
    1.png
    23.4 KB · Views: 3
  • 2.png
    2.png
    11.8 KB · Views: 3
Probably because I tried the script on localhost, php, without running:

php scriptname.php > list.txt
Can you make it to work when I upload it to the server?
 
Back
Top