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 4627388
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:33:38+00:00 2026-05-22T03:33:38+00:00

I am developing a site where users will have permalinks for them like user.domain.com

  • 0

I am developing a site where users will have permalinks for them like user.domain.com or domain.com/user and i want to achieve this by php code. foe ex.
for username stack the permalink is stack and on going to stack.domain.com or domain.com/stack it should go to profile page of user!

  • 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-22T03:33:39+00:00Added an answer on May 22, 2026 at 3:33 am

    Let’s split the two cases:

    user.domain.com

    For this to work, you should first configure your DNS so that *.domain.com points to your server. Then in index.php, you can check if $_SERVER["HTTP_HOST"] matches something.domain.com (using e.g. preg_match). After verifying something is a valid username, you can either display the user’s profile page or redirect to the profile.

    Caution: make sure that any subdomain you use yourself, like for example www., is not a valid username.

    domain.com/user

    To implement this, you need to setup some kind of catch-all for non-existing pages. One way would be to instruct your webserver to serve a php-file when it encounters a 404. This file could then use the $_SERVER["REQUEST_URI"] variable to determin if there if a user profile is requested.

    Caution: Make sure that any /something that is already a valid page is not a valid username. Alternatively you could use a prefix like domain.com/u/user to be more flexible in the names of your own pages.

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

Sidebar

Related Questions

I'm developing a PHP website that uses url routing. I'd like the site to
Scenario I have a site where users can register for a course, I'm developing
I'm developing a Wordpress site that will let (registered) users upload an image and
I'm developing a site that sends email notifications to users after certain events/user actions
I am developing a web application with PHP where a user will be able
I am interested in developing a site similar to youtube. I want to have
Background I'm developing a django app for a vacation rental site. It will have
I've been developing a site using ASP.NET MVC, and have decided to use the
I am developing as site for mobile devices which requires the user to select
I'm developing a site that allows a user to create an order for a

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.