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

  • Home
  • SEARCH
  • 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 6097661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:04:09+00:00 2026-05-23T13:04:09+00:00

How to catch all characters after domain name as one parameter with mod_rewrite? I

  • 0

How to catch all characters after domain name as one parameter with mod_rewrite?
I have script which load other page content and displays that like standard page.
example script address look like that:

example.com/script.php/?www='/some/paths/etc'

I want to mask that URL to look like this:

example.com/some/paths/etc

If no paths exist it should look like

example.com/

There can be different amount of URL parts (a/b/c/…/X/)

I red about mod_proxy but I can do it with only .htaccess so it doesn’t solve my problem.
I can’t redirect one address to other, they have to be separated.

  • 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-23T13:04:10+00:00Added an answer on May 23, 2026 at 1:04 pm

    You can proxy via mod_rewrite (as long as mod_proxy has been compiled into the server), and this can be done via .htaccess files. Note that RewriteEngine On requires Options FollowSymLinks to be overridable in your .htaccess.

    The following in your .htaccess file:

     Options FollowSymLinks
     RewriteEngine On
     RewriteCond %{REQUEST_URI} ^/script.php/?www=
     RewriteRule ^/script.php/?www='([^']+)' http://example.com/$1
     RewriteRule ^/(.*) /script.php/?www='$1' [P]
    

    The RewriteCond matches your script path with a ?www= argument (if it fails to match no rewrite will take place). The first RewriteRule will match the www= argument and rewrite the visible path of the request. The second RewriteRule will then proxy the request (due to the [P] flag) to the script and will get the “content”.

    Note: this has not been tested, but hopefully will get you heading in the right direction to solve the problem. Also if script.php expects optional args &var2=whatever you will probably need to tweak the RewriteCond to match that and store it using parentheses. You can then recall those args using %1. More details can be found in the documentation.

    Also to help you debug your rewriting you can use:

    RewriteLog /full/path/to/your/log/file
    RewriteLogLevel 3
    

    EDIT: Added the RewriteLog stuff an clarified that the snippet at the top is to be put in the .htaccess file

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

Sidebar

Related Questions

I need a little help creating a catch-all error handling page in my ICEfaces
I have a text file which all contain the following fragments of code in
In my application i have to validate XML data and pickup all invalid characters
Java requires that you catch all possible exceptions or declare them as thrown in
how can I catch all strings from a native windows .exe file and replace
I would like to catch all dev tags and their respective content, through php
I am writing a catch all method for my controller for ajax. It is
Is there any way to catch all syscalls on Linux? The only solution I
I'm helping a colleague develop a catch all type error handler for some controls
How do I create a catch-all URL-mapping in Grails? The following Grails UrlMapping ..

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.