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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:23:29+00:00 2026-06-18T01:23:29+00:00

Having spent the past few hours looking for a solution, I thought I’d ask

  • 0

Having spent the past few hours looking for a solution, I thought I’d ask here.

I’m looking for a way to process links such as:

http://subdomain.domain.com/page/subpage/

so they are passed to the server as:

http://domain.com/index.php?subdomain=subdomain&page=page&subpage=subpage

which can be taken by index.php to display the correct page information.

I can get the page and subpage to work but have no clue how to get the subdomain. Note: if there is no subdomain, I would like that field to either be left blank or contain a default value.

Any assistance would be much appreciated. 🙂

Edit:
Just to clarify, I want the first URL to be what the user sees and can input into the address bar and the second URL to be the page that is loaded by the server when the user navigates to the first URL.

My .htaccess file

Options +FollowSymlinks -MultiViews -Indexes

RewriteEngine On
RewriteBase /

# Remove 'www'
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Add slashes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://resolutiongaming.com/$1/ [L,R=301]

# Subdomain redirect
RewriteCond %{HTTP_HOST} ^resolutiongaming.com$
RewriteRule ^webdev/$ http://webdev.resolutiongaming.com [R=301,L]
RewriteRule ^artwork/$ http://artwork.resolutiongaming.com [R=301,L]
RewriteRule ^music/$ http://music.resolutiongaming.com [R=301,L]

ErrorDocument 404 /error.php
  • 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-06-18T01:23:30+00:00Added an answer on June 18, 2026 at 1:23 am

    You may try this in one .htacces file in root directory:

    Options +FollowSymlinks -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST}  ^(?:www\.)?([^\.]+)\.domain\.com
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI}  ^/([^/]+)/([^/]+)/?   [NC]
    RewriteRule .*     http://domain.com/index.php?subdomain=%1&page=%2&subpage=%3  [R=301,L]
    

    It will redirect permanently:

    http://subdomain.domain.com/page/subpage/ or http://www.subdomain.domain.com/page/subpage/

    To:

    http://domain.com/index.php?subdomain=subdomain&page=page&subpage=subpage

    For the rule to work, the incoming URL scheme: /page/subpage/ must be kept.

    To replace permanent redirection with silent mapping, remove R=301 from [R=301,L] or replace it with R for temporal redirection.

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

Sidebar

Related Questions

I've spent a few days searching a for solution to my problem. I'm having
Having spent a small age looking for the solution and having now found it,
Having spent the past few weeks familiarising myself with WSS 3.0 I finally want
I've been having problems with this code I had spent the last 3 hours
having spent hours on this problem i need to throw it out to the
My db server is is having continuous high CPU load for the past few
Despite having spent countless hours examining line of code, and after creating a fully
after having spent few months in trying to master the syntax and rules, I
I spent some time having problems with this so, thought I would share the
New to MVC3 Razor - linq to sql having spent some time trying to

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.