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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:11:33+00:00 2026-06-03T10:11:33+00:00

This question has been edited for clarification: I am trying to create "pretty URLs"

  • 0

This question has been edited for clarification:

I am trying to create "pretty URLs" that should disguise themselves as follows:

mysite.com/index.php?p=1 ==> mysite.com/site_one/index.php

mysite.com/aboutus.php?p=2 ==> mysite.com/site_two/aboutus.php

mysite.com/anypage.php?p=3 ==> mysite.com/site_three/anypage.php

As you can see, mod_rewrite should simply convert the "p" variable into a predetermined pseudo-directory (this directory does not exists…this is just an aesthetic rewrite).

Obviously, this creates a complication. When a user visits mysite.com/site_one/index.php, there should be a background transfer to mysite.com/index.php?p=1. This background transfer results in a loop that causes a server error.

I have attempted to prevent this loop by using the following code:

RewriteCond %{QUERY_STRING} !NON=
RewriteCond %{QUERY_STRING} ^(.*[&?])?p=1([&].*)?$
RewriteRule ^/?(.*)  /site_one/$1 [PT,L]


RewriteCond %{QUERY_STRING} !NON=
RewriteRule ^/?site_one/?(.*)  /$1?NON=1&p=1 [PT,L]

Unfortunately, this still causes a server error. Can anyone see where the code has gone wrong?

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

    I wound up having to work around this, as no htaccess method was helping me. I basically forwarded all values of “p” to the appropriate page and changing the variable “p” to the variable “s”. I then told my web app that the value of “p” is equal to the value of “s” where “s” exists. I put this code in a file that communicates with the server, so it is present on all of my site’s pages.

    It’s ugly and sloppy, but so is the reason I have to do it in the first place.

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

Sidebar

Related Questions

Warning: This question has been heavily edited. I tried my best to guess the
NB: This question has been extensively edited to make it more relevant, for completeness
This is a simple question that has been bugging me. In XCode 4.2, is
** This question has been edited to make it simpler and more focused **
I know that this question has been done to death at StackOverflow and that
N.B This question has been significantly edited before the first answer was given. Hi,
This question has been edited to ask about a specific example as the original
This question has been edited: I am working with QML. I have a custom
This question has been asked in a C++ context but I'm curious about Java.
This question has been puzzling me for a long time now. I come from

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.