May i know how to check the dynamic url availability for the user within the domain, so that they are allowed to create their own site-url's
Steps that I am following: 1) Through text box they will be able to write their nickname/personal_identity eg: say Custom_Blog
2) So, my website domain would be http://example.com/Custom_Blog/ for the specified user.
3)Conflict: But I do have a tab "http://example.com/Custom_Blog" link created in the htaccess which is used for editing the Blog detailed page of the user.
So, while user entering in the text box i need to validate the availability of the url whether the url is already in use or not ? I tried this code which was not helpful because it was getting the code 302 for the url's that are already used(exists):
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
/* Get the HTML or whatever is linked in $url. */
$response = curl_exec($handle);
/* Check for 404 (file not found). */
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
if($httpCode == 404 || $httpCode == 302) {
/* Handle 404 here. */
}
curl_close($handle);