Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6750845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:51:23+00:00 2026-05-26T12:51:23+00:00

I want to stop all the IPs and subdomains completely. Someone edit/modify it so

  • 0

I want to stop all the IPs and subdomains completely. Someone edit/modify it so it won’t add IPs and subdomains into database. I only want main (Top-Leven Domain) in my database. Here’s the pattern i am using:

$pattern = '/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/';

if (preg_match($pattern, $url) ) {
header("Location: good.php");
} else {
header("Location: bad.php");
die();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:51:24+00:00Added an answer on May 26, 2026 at 12:51 pm

    A toplevel domain only contains letters. Here is a list of TLDs.

    I assume you meant to say ‘second level domains’, but even that will give you trouble. For instance, .co.uk is a very popular SLD, but it is not used for a website or anything. The domains you mention, are on the third level, below this SLD. (anycompanywebsite.co.uk).

    So, what I’m saying is that you cannot do this using a simple regex. You will need to have a list of second, third and even fourth levels that are used as if they are a TLD.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using hibernate 3 and want to stop it from dumping all the startup
In particular: I want to replace all occurances of a full stop \. with
I want to stop following a user if and only if I have left
I want to stop out all characters that do NOT match this regex pattern:
Possible Duplicate: Stop all active ajax requests in jQuery I want to have a
I want to stop click on any links until the page is loaded. Can
I want to stop outgoing call and open the application. The app is able
I have a simple Python script that I want to stop executing if a
Is there any way to stop polling server in SignalR? I want to stop
for example, if I want to stop lan connection 1 in my control pannel,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.