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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:06:04+00:00 2026-05-26T21:06:04+00:00

I don’t have much experience with web.config files but what I am trying to

  • 0

I don’t have much experience with web.config files but what I am trying to do is redirect all requests to index.php only add ?url=REQUESTED_PAGE

eg

if you went to domain.com/about.php?query=string

it would rewrite the url as domain.com/about/ to the user
but process the urldomain.com/index.php?url=about.php&query=string

the idea is to have nice looking user friendly urls whilst the index.php works out which page to show the user. (well am using smarty so which template to use)

EDIT: I am looking for help with web.config not .htaccsess I am restricted to the clients hosting and that isn’t apache unfortunately and the only mod I can find that may or may not work with iis7.5 is £45 which I can not get funding for 🙁

EDIT: My latest attempt is

<rules>
  <rule name="page proc" stopProcessing="true">
    <match url="domain.org.uk(.*?)\?(.*)" />
    <action type="Redirect" url="{R:0}?url={R:1}?{R:2}" />
  </rule>
</rules>

I think I am close but still not working

SOLVED :: !END RESULT!

<rewrite>
    <rules>
            <rule name="page proc">
                <match url="(.*?)\/" />
                <action type="Rewrite" url="/index.php?url={R:1}" appendQueryString="false" logRewrittenUrl="true" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    <add input="{QUERY_STRING}" pattern="(.*?)(css|js|pdf|jpg|png|gif)" negate="true" />
                </conditions>
            </rule>
        </rules>
    </rewrite>
  • 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-26T21:06:04+00:00Added an answer on May 26, 2026 at 9:06 pm

    You’d need to create a .htaccess file with the following:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
    

    This will pass all requests (unless it’s an existing file or directory) to your index.php script, and you’ll be able to find out what the user requested in your PHP script by doing:

    <?php
    echo $_GET['url'];
    ?>
    

    So you may split the passed url parameter at the slashes and pass it off to the correct controller or whatever.

    The reason you don’t rewrite existing files or directories is static files like images, stylesheets, JavaScript files etc. Otherwise requests for those files that do exist would still be passed to your index.php script.

    Also, the QSA flag after the RewriteRule allows you to continue using query strings in URLs if you wish for things like search form and pagination if you prefer to use $_GET parameters for those too instead of URL segments.

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

Sidebar

Related Questions

don't know if the title describes anything about what I'm trying to say but
Don't ask me how but I'm in a situation where I have DCPs published
Don't know how to explain it better but i'm trying to get a response
Don't have much to say, just can get into the event handler. XAML: <Grid>
Don't know if this is possible, but I have some code like this: val
I don't have much knowledge about the IPv6 protocol, so sorry if the question
Don't know if I'm over-thinking this or not.. but I'm trying to be able
Don't know why but I can't find a solution to this. I have 3
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't ask why but I have the requirement to draw a border around certain

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.