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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:48:44+00:00 2026-05-25T12:48:44+00:00

I will inform you briefly what I am doing and where I will need

  • 0

I will inform you briefly what I am doing and where I will need your help.

I am building blog hosting site. I finished CMS and now i am doing user pages.

My idea was to create .htaccess rules so every user and blog owner will have its own blog URL, like: XXX.bloghost.com, where XXX is blog name or blog owner name.

Just to mention that I will use 2 more parameters in URL so here are examples of URLs:

XXX.bloghost.com -> www.bloghost.com/index.php?user=XXX

XXX.bloghost.com/NEWS -> www.bloghost.com/index.php?user=XXX&category=NEWS

XXX.bloghost.com/NEWS/SAMPLE -> www.bloghost.com/index.php?user=XXX&category=NEWS&post=SAMPLE

Here is my current .htaccess file (UPDATED):

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !www.bloghost.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).bloghost.com [NC]
RewriteRule (.*) %2/$1 [L]

RewriteRule (.+)/(.+)/(.+) blog.php?blog_id=$1&category=$2&post=$3 [L,QSA]
RewriteRule (.+)/(.+) blog.php?blog_id=$1&category=$2 [L,QSA]
RewriteRule (.+) blog.php?blog_id=$1 [L,QSA]


ErrorDocument 404 /error.php

I would really need some help with this. I tried and followed several tutorials on this but with no luck.

Also, can this .htaccess block or redirect all mistyped or not existing URLs to some page?

  • 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-25T12:48:45+00:00Added an answer on May 25, 2026 at 12:48 pm

    At first, you must configure you subdomains for the wildcard

    ServerAlias www.domain.com domain.com *.domain.com
    

    And be sure that DNS configured for wildcards too. Than use something like this:

    RewriteCond %{HTTP_HOST} !www.domain.com$ [NC]
    RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+).domain.com [NC]
    RewriteRule (.*) %2/$1 [QSA]
    

    So after this page http://some.domain.com/news will go to http://www.domain.com/some/news
    And than process the url as usual (just for example):

    RewriteRule (.+)/(.+)/(.+) index.php?user=$1&category=$2&post=$3 [L,QSA]
    RewriteRule (.+)/(.+) index.php?user=$1&category=$2 [L,QSA]
    // and so on
    

    But I think that second part should be handled with php routing system.

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

Sidebar

Related Questions

I need to inform my user about the result of the GET process whether
I'm trying to create a UILabel which will inform the user of what is
I want to inform a user if javascript is disabled in the browser and
I'm trying to find an elegant way to inform a user that s/he is
This post discusses how to inform the user via a progress bar by calculating
I'm making an HTML5 game, and I need a way to textually inform the
Many times, when generating messages to show to the user, the message will contain
I am currently developing an Android app that is supposed to inform the user
Im building a small application for my employer where hitting a certain keystroke will
When you first try to access a user's ALAssetsLibrary, the OS will present them

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.