mod_rewrite changing url in browser address window

New to mod_rewrite? This is a good place to start.

mod_rewrite changing url in browser address window

Postby LaidBackWebSage » Mon Nov 21, 2005 11:35 am

Here is my rule set:
Code: Select all
<VirtualHost *:443>
ServerAdmin webmaster@example.com
DocumentRoot /path/to/doc/root
ServerName  name.example.com
ServerAlias   \
tst1a.example.com \
tst2a.example.com \
tst3a.example.com \
tst4a.example.com \
tst5a.example.com
                                                                               
ScriptAlias /cgi-bin/ /path/to/doc/cgi-bin/
ErrorLog  /path/to/doc/logs/error_log
CustomLog /path/to/doc/logs/access_log combined
Options +FollowSymlinks

RewriteEngine On
RewriteRule  ^/foo/(.*)\.php$ https://%{HTTP_HOST}/bar\.php?var=$1 [L]

<SSL config stuff continues...>
</VirtualHost>


The problem is the browser displays the rewritten url (https://%{HTTP_HOST}/bar\.php?var=$1); I want the original, incoming url (^/foo/(.*)\.php$)

Real world example: "https://www.example.com/foo.php" would be rewritten to "https://www.example.com/bar.php?var=foo", but when the page change occurs the URL in the address/location bar should still be "https://www.example.com/foo.php".

Unfortunately, I'm seeing "https://www.example.com/bar.php?var=foo". I don't want that. :)

And before anyone asks, there are no redirects of anykind within my conf file.

Anyone got any ideas?

Thanks! :)
LaidBackWebSage
 
Posts: 1
Joined: Mon Nov 21, 2005 11:17 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 43 guests

cron