Solved

rewriterule: Why test/home becomes test?/home

Posted on 2004-04-01
4
195 Views
Last Modified: 2010-03-04
Hi,

I the code below to make test.php?content=home look like test/home, but when I enter test/home the URL in my addressbar show test?/home. I hate that ? so I am looking for a solution to drop that ?. Also I am wondering if there is an easier way. Because now I have to declare each file with the files statement. I am working on a .htaccess bases, because I don't have access to the .conf file for this.

The code I am using:
<Files test>
ForceType application/x-httpd-php
</Files>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^test/([/A-Za-z0-9_]*)$  test?/$1 [R]
</IfModule>

thnx
0
Comment
Question by:dhosting
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
BigRat earned 250 total points
ID: 10739522
RewriteRule ^test/([/A-Za-z0-9_]*)$  test.php?content=$1 [L]

Use L for Last and not R for Redirect. The R sends a redirect BACK to the browser. There is no reason why the browser should see the rewrite.

You can then drop the Files/mime association.

HTH
0
 

Author Comment

by:dhosting
ID: 10886315
Hi,

Whenever I am going to a URL, let's say test/something, $content is defined as test and not something.

thnx

0
 

Author Comment

by:dhosting
ID: 10886375
I played with it somemore and now it works great!

thnx a lot
0
 
LVL 27

Expert Comment

by:BigRat
ID: 10887912
OK. I suspect that you did not do a Copy&Paste with the rule and lost something!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now