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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:49:15+00:00 2026-06-11T10:49:15+00:00

I am working on making my site more SEO friendly I am currently using

  • 0

I am working on making my site more SEO friendly I am currently using

RewriteEngine On
RewriteRule (.*)$ index.php?page=$1

To turn site.co.uk/index.php?page=page_name into site.co.uk/page_name

I want to also use this for sub pages too.
I have tried this:

RewriteEngine On
RewriteRule (.*)/(.*)$ index.php?page=$1&subpage=$2

but its not working, it runs site.co.uk/page_name/sub_page but when you go to site.co.uk/page_name it returns the 404 not found.

I want it to run site.co.uk/page_name and it return page_name

or

site.co.uk/page_name/sub_page and return sub_page

and so on

site.co.uk/page_name/sub_page/sub_page2/...

  • 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-11T10:49:16+00:00Added an answer on June 11, 2026 at 10:49 am

    Using just:

    RewriteEngine On
    Options -Indexes
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
    

    is fine then you can route the request within your script.

    You split the page variable with explode() delimiter / and then set the variables.

    $route = explode('/',$_GET['page']);
    
    $page    = isset($route[0]) ? $route[0] : null;
    $subpage = isset($route[1]) ? $route[1] : null;
    $yada    = isset($route[2]) ? $route[2] : null;
    

    Many MVC frameworks use this method. Its called routing.

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

Sidebar

Related Questions

i'm working on a wordpress site using buddypress. So, i'm making a page where
I'm making a site in php and I'm using google custon search for my
I'm working on an ASP.NET MVC site, using EF4 and Automapper. I'm making good
I've rewritten my family web site using JavaScript (JQuery) making Ajax calls to PHP
I am working on making a book catalog searchable using Solr. I have written
I'm working on making some code using metaheuristics for finding good solutions to the
Whoever wrote the navigation for the site I’m currently working on (classic asp) points
I'm working on making a modification to a site built with ASP/C#, and one
I am working on taking an IE only site and making it cross browser.
i am making a small tooltip feature for my site i had this working

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.