Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

reverse mod_rewrite

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
Need Help with reverse Proxy - Hi, i have same troubles with my Reverse Proxy I have two dns entrys that points to the same IP Adress in the Internet. From this Server i want to redirect the Request to internal Web Server. ..

Reverse proxy help - I am trying to setup a reverse proxy using apache 2048. I have 1 server inside our network named that is only connected to our internal lan. The reverse proxy is connected to the internet with a static IP number and also the internal lan. From..

ftp proxy reverse - Hello! Some one can help me about Ftp proxy reverse on Apache 2? Thank you

Apache as reverse proxy to OWA 2003 - This is a of the thread titled proxy with SSL, redirects to non-SSL I promised that after I figured things out I would post a solution here. First, a brief of the problem. I wanted to use Apache 2.0 to serve..

Buffering reverse proxy - I am suffering an problem at a client of mine. We use Apache (2.0) with a Tomcat (3.1.3, moving to 4.1.30) for a 24/7 Users from all over the world access this server in all with (of course)
Next:  Apache: Apache on showing index.html  
Author Message
ironcito

External


Since: Dec 15, 2005
Posts: 3



(Msg. 1) Posted: Thu Dec 15, 2005 10:35 pm
Post subject: reverse mod_rewrite
Archived from groups: alt>apache>configuration (more info?)

Hi all,

Here's the issue. I have a page with a search form. I use method=get,
so when the user searches for "string", the form gets
example.com/script.php?query=string
I want the URI to become example.com/search/string (which would then be
re-rewritten to have a script actually perform the search)
I tried writing a rule for it, but URI-passed variables seem to mess it
up. I can get it to rewrite script.php to /search, but I can't
transform the variables. How can I do this? Thanks in advance.

Diego

 >> Stay informed about: reverse mod_rewrite 
Back to top
Login to vote
ironcito

External


Since: Dec 15, 2005
Posts: 3



(Msg. 2) Posted: Fri Dec 16, 2005 1:43 am
Post subject: Re: reverse mod_rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Davide Bianchi wrote:

> If you search some messages before, there was quite a discussions about
> the pro and cons of doing it.

You mean the pros and cons of having a simple URI for displaying search
results? What could be the cons of having /search=string instead of
/search.php?query=string ? Do you have a link to a discussion on the
subject? I can't think of any disadvantage to that approach.
Thanks for your help Smile

Diego

 >> Stay informed about: reverse mod_rewrite 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 3) Posted: Fri Dec 16, 2005 3:55 am
Post subject: Re: reverse mod_rewrite [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
google

External


Since: Dec 17, 2005
Posts: 1



(Msg. 4) Posted: Sat Dec 17, 2005 6:52 am
Post subject: Re: reverse mod_rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I was able to do this by learning from WordPress' mod_rewrite(s) and
use variants of:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=39]
RewriteRule ^(.+[^\.])/?$ /index.php?page=$1 [QSA,L]

"index.php" is the hidden script that does the work behind the scenes.

another version:

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [S=39]
RewriteRule ^([\w]+\-.*\.php)$ display.php?page=$1 [QSA,L]

"display.php" is the hidden script working behind the scenes.

The trick is to get the REGEX inside the parenthesis to match what you
are looking for. You'll probably have better luck with the first, as
the second looks for "file names" containing dashes.

Then, inside PHP, use functions to break apart and identify the query.
 >> Stay informed about: reverse mod_rewrite 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]