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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:17:56+00:00 2026-05-27T17:17:56+00:00

I’m working on a website and need to do some URL rewriting It’s very

  • 0

I’m working on a website and need to do some URL rewriting

It’s very similar to $_GET URL ReWriting but I can’t seem to make it work

Basically in my index.php I’m using a $_GET variable to display content

<?php
$page = basename($_GET['page']).".php";
if(file_exists("content/".$page))
    include("header.php");
else
    include("header_index.php");
?>

<div id="main">
<!-- container -->
    <?php
    if (file_exists("content/".$page))
        echo '<div id="container">';
    else
        echo '<div id="container" class="index_container">';
    ?>
        <!-- content -->
            <div id="content">
                <?php
                    if(file_exists("content/".$page))
                        include("content/".$page);
                    else
                        include("content/index_page.php");
                    include("./content/right_menu.php");
                ?>
            </div>
        <!-- content -->
    </div>
<!-- /container -->
</div>

<?php
    include("./footer.php");
?>

That way test.com/?page=test1 displays website_folder/content/test1.php

What I’m trying to do is to make it to test.com/test1

All of the links on my pages are like <a href="?page=testX">Test X</a>

Thank you

edit :
Rewrite rules tried
RewriteRule (.*)$ ?page=$1
RewriteRule ./([a-zA-Z]+)$ ./index.php?page=$1
RewriteRule /([a-zA-Z0-9]) /?page=$1
RewriteRule ^subdomain.test.com/subfolder/(.+) subdomain.test.com/subfolder/index.html?page=$1 [NC]
RewriteRule (.+)$ index.php?page=$1

  • 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-27T17:17:57+00:00Added an answer on May 27, 2026 at 5:17 pm

    This should do:

    RewriteRule ^subdomain.test.com/subfolder/(.+) subdomain.test.com/subfolder/index.html?page=$1 [NC]
    

    It works for me!

    (Note the .html. You may need to change it to .php, .asp ect.)

    You will also need:

    Options +FollowSymLinks
    RewriteEngine on
    

    Above the previous statement.

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

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.