rewriterule: Why test/home becomes test?/home

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
dhostingAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BigRatConnect With a Mentor Commented:
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
 
dhostingAuthor Commented:
Hi,

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

thnx

0
 
dhostingAuthor Commented:
I played with it somemore and now it works great!

thnx a lot
0
 
BigRatCommented:
OK. I suspect that you did not do a Copy&Paste with the rule and lost something!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.