Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a rewrite rule that works fine, but the reason why we're rewriting is because the target URL is not so tidy. ->

What I would like to do is keep the URL in the browser, but show the page. Is this possible?

share|improve this question
Yes, it's possible. Show your rewrite rules. – joschi Jul 4 '10 at 13:28

mod_rewrite it what you need.

This is quite easy and its a powerfull tool.

I suggest to read this ->

And example :

this estarts de rewriteengine, then applies some conditions and if they are true then applies the rewrite itself. its like a while/case codeblock.

The most helpful part is the log .;)

    RewriteEngine on
RewriteLogLevel 0
RewriteLog "/var/www/rewrite.log"

<Directory /var/www>

    Options -ExecCGI -Indexes
    AllowOverride none
    Order allow,deny
    allow from all
    #SetHandler none

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(\w+.\w+)/(es|ca|en)/$ index.php?user=$1&lang=$2 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(\w+.\w+)/$ index.php?user=$1&lang= [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(\w+.\w+)/(\w+)?(/(.*))?$ index.php?user=$1&lang=$2$4 [L,QSA]

also, you can look at mod_proxy, it will do the trick but it's not the 'good way' in my opinion.

hope it helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.