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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:21:18+00:00 2026-05-19T03:21:18+00:00

I want to write a .htaccess from which the following action should be done.

  • 0

I want to write a .htaccess from which the following action should be done.

I have domain like

www.xyz.com 

and am putting many articles on that.
so it wil become

www.xyz.com/article1-tutorial/
www.xyz.com/article2-tutorial/
www.xyz.com/article3-tutorial/

But instead of that i need like this.

www.article1-tutorial.xyz.com/
www.article2-tutorial.xyz.com/
www.article3-tutorial.xyz.com/

Please help to find the solution. I know we cant go for subdomain concept and only the way is redirection. So whats is the solution?

  • 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-19T03:21:18+00:00Added an answer on May 19, 2026 at 3:21 am

    You’ll need something like this in your apache.conf:

    <VirtualHost *:80 >
            ServerName automated_domains
            ServerAlias *.xyz.com
            VirtualDocumentRoot /home/xyzcom/website/
    </VirtualHost>
    

    Then in the PHP file you put in /home/xyzcom/website, you can get the domain that was actually called in the $_SERVER['HTTP_HOST'] variable.

    Hope this helps!

    KKovacs

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

Sidebar

Related Questions

I have an url which is http://www.urlbookmarking.com/bookmarks-details.php?bid=55 and I want it to be like
I want to create URL re-write rules for following URL in htaccess. http://example.com/vedios/category/fun/ ->
I have my site which redirects all *.domain.com calls to domain.com. What I want
I want write a simple query which will fetch data from a table (which
I have a .htaccess redirect for non www like this: RewriteEngine on RewriteCond %{HTTP_HOST}
I want that every user has a profile-url like this: www.example.com/username But my php
I have a directory on server, from which I only want .JPG files to
I have a domain name with wildcard dns active. what i want to write
For example, for www.example.com/foo/dosomething/ , I have such a htaccess document: RewriteEngine On RewriteRule
I have htaccess and I want to write same functioning in web.config but don't

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.