1

I have wildcard subdomains set up where the subname is incorporated in the code to determine a username. So name.domain.com gives the value Name. That works fine. But I'd like to have "wildcard subfolders" where if it's a numeric value, say name.domain.com/2, attribute the numerically titled subfolder to the page's code as well. In that case, "2" would be the 'subfolder' value.

In /public_html/wildcard/index.html I have the following,

<?php
$subname = $_SERVER["HTTP_HOST"];
$subname = explode( ".", $subname );
$subname = array_shift( $subname );
$subname = ucwords( $subname );
if (isset($subname)) {$comma=", ";} ?>

That sets the subdomain to variable $subname (with first letter capitalized). Now how could I make variable $subfolder indicate the subfolder if it is a numeric value? example.domain.com/56 would make $subfolder "56". The value is then called in the file by,

<?php echo $subfolder;?>

Any help would be tremendous. Thank you.

That Guy
  • 11
  • 2

0 Answers0