mod_rewrite: must the rewritten url exist? (nu-B)

This is a discussion on mod_rewrite: must the rewritten url exist? (nu-B) within the Apache Web Server forums, part of the Web Server and Related Forums category; suppose the requested url is www.server.com/page.php?qs=s and in the address bar i want it ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-14-2006
zorro
 
Posts: n/a
Default mod_rewrite: must the rewritten url exist? (nu-B)

suppose the requested url is
www.server.com/page.php?qs=s

and in the address bar i want it displayed as
www.server.com/s

while still serving www.server.com/page.php
and not having any www.server.com/s/index.php

is this possible?

  #2 (permalink)  
Old 05-14-2006
Robert Ionescu
 
Posts: n/a
Default Re: mod_rewrite: must the rewritten url exist? (nu-B)

Yes, this is possible, no the filename can exist but needn't.

And where do you expect to use mod_rewrite? In your
httpd.coonf/per-server context or in per-dir context (e.g. .htaccess files)?

RewriteEngine on
# exclude slash and period
RewriteRule ^([^/.]+)$ /page.php?qs=$1 [L]

--
Robert
  #3 (permalink)  
Old 05-14-2006
zorro
 
Posts: n/a
Default Re: mod_rewrite: must the rewritten url exist? (nu-B)


Robert Ionescu wrote:
> Yes, this is possible, no the filename can exist but needn't.
>
> And where do you expect to use mod_rewrite? In your
> httpd.coonf/per-server context or in per-dir context (e.g. .htaccess files)?


It probably will be on a server where I cannot access httpd.conf.
>From the little I've read, I remember something about having to use

rewriteBase.

> RewriteEngine on
> # exclude slash and period
> RewriteRule ^([^/.]+)$ /page.php?qs=$1 [L]

This is really strange...

I would've written something like
RewriteRule ^(.*=)(.*)$ www.server.com/$2

Anyway, don't give me the answer to this one, I need the homework :)


>
> --
> Robert


  #4 (permalink)  
Old 05-14-2006
Robert Ionescu
 
Posts: n/a
Default Re: mod_rewrite: must the rewritten url exist? (nu-B)

zorro wrote:
> I remember something about having to use
> rewriteBase.


If you use a filepath in th substitution and an alias or mod_userdir,
yes. But with an URL-path in the substitution: no.

--
Robert
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:05 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0