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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:00:36+00:00 2026-06-19T00:00:36+00:00

Let’s say I got 5 pages ( index.php , about.php , portfolio.php , gallery.php

  • 0

Let’s say I got 5 pages (index.php, about.php, portfolio.php, gallery.php, contact.php).

Let’s say the id is 1.

The original url is :

www.domain.com/folder/index.php?id=1,
www.domain.com/folder/about.php?id=1
and so on…

Now, I want to change it to :

1.domain.com/index,
1.domain.com/about,
1.domain.com/portfolio,
1.domain.com/gallery,
1.domain.com/contact

Is it possible with mod-rewrite ? And if I’m in the index.php page, whats the <a href="" > that goes to about.php if the mod-rewrite is possible?

Thank you very much 😀 I appreciate your help 😀

EDIT

One more thing, My wildcard subdomain folder is public_html/folder/

The Solution By Anubhava

Edited with subdomain codes :

Options +FollowSymLinks -MultiViews

RewriteEngine On
RewriteBase /

# EDIT BY ANUBHAVA: to make http://1.domain.com/ load /about as default page
# Replace /about with any other page you want as default page
RewriteCond %{HTTP_HOST} ^1\.(domain\.com$ [NC]
RewriteRule ^$ /about [L]

RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([^.]+).domain.com$ [NC]
RewriteRule ^(index|about|portfolio|gallery|contact)/?$ /$1.php?id=%2 [L,NC,QSA]

Make sure your wildcard subdomain directory is where the pages are. Also put your .htaccess file in the directory where the pages are.

  • 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-19T00:00:37+00:00Added an answer on June 19, 2026 at 12:00 am

    Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    # EDIT: to make http://1.domain.com/ load /about
    RewriteCond %{HTTP_HOST} ^1\.(domain\.com$ [NC]
    RewriteRule ^$ /about [L]
    
    RewriteCond %{HTTP_HOST} ^1\.(domain\.com$ [NC]
    RewriteRule ^(index|about|portfolio|gallery|contact)/?$ http://www.%1/folder/$1.php?id=1 [R=302,L,NC,QSA]
    

    Once that is in place create href links like this:

    <a href="http://1.domain.com/about">About Us</a> or <a href="http://1.domain.com/contact">Contact Us</a>

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

Sidebar

Related Questions

Let's say I've got two files class.php and page.php class.php <?php class IUarts {
Let's say I got this string: $str = alemylaife; (I know it's misspelled, all
Let's say I have a user enter the URL of an image. After URL
Let's say I have a domain object with the following field: private Map<StatType, Double>
Let's say that I've got a sheet - number one - with over 5000
Let's say, I've got a XmlNode: <A>1</A> How to remove a text from it,
Let's say I've got a collection of 10 million documents that look something like
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
Let's say I don't have photoshop, but I want to make pattern files (.pat)
Let's say I have a method in java, which looks up a user in

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.