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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:25:19+00:00 2026-06-05T17:25:19+00:00

I have a single page website that changes content based on variables passed through

  • 0

I have a single page website that changes content based on variables passed through the URL with PHP.

For instance, my url displays as

www.mysite.com/index.php?section=home
www.mysite.com/index.php?section=about-us

so forth and so on, depending upon which link you click in the main navigation.

I want the urls to read as www.mysite.com/home or www.mysite.com/about-us.

My mod-rewrite feature is enabled because before I made this a one page site, it was functioning correctly.

I’ve tried this…

RewriteEngine on
RewriteBase /
RewriteRule ^home/?$ index.php?section=$1 [NC,L]

I’ve tried every suggestion I found on Google and on StackOverflow, nothing is working.

Any help would be appreciated!

  • 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-05T17:25:23+00:00Added an answer on June 5, 2026 at 5:25 pm

    I have an .htaccess for exactly the same purpose, and it’s working beautifully. My code is below.

    RewriteEngine On
    RewriteRule ^([^/\.]+)/?$ index.php?id=$1 [L]
    

    Naturally, if index.php isn’t your main PHP file, replace that with what is. Also, replace ?id with ?section if your example code is what your using.

    What the [^/\.]+ means is saying I need you to find text that contains anything but a period (.) or a forward slash (/), and there has to be at least one character in it.

    For an example, go to the website I’m using it on, Northside Aikido.

    If you have any questions, please feel free to ask.

    EDIT

    Note, this code won’t turn http://www.example.com/index.php?section=home into http://www.example.com/home automagically, it’ll just mean that the latter link works like the former. If you want it to automatically replace it, you’ll need more code than one line.

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

Sidebar

Related Questions

Basically I have a single page on my site that I want any php
I have a large, dynamically generated, single page website that heavily relies on javascript.
I have modified a website with a redirection to a single page: RewriteCond %{REQUEST_FILENAME}
I have a single page application written in MVC4 that uses pjax() to push
Basically I have a single page site that scrolls when the user clicks on
I have table called page which represents every single page in my website. page_id
I have a single-page JavaScript application, held within an ASP.NET MVC 3 website. In
We have a large ASP.Net website that has a single css stylesheet which is
I have a website that consists mainly of a single Silverlight application. The website
I have a single page website which has a fixed floating nav. I want

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.