Solved

rewriterule: Why test/home becomes test?/home

Posted on 2004-04-01
4
202 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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