Solved

rewriterule: Why test/home becomes test?/home

Posted on 2004-04-01
4
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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