Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

URL rewrite help - redirect complete URI

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  htaccess / password not working  
Author Message
arun.iit

External


Since: Mar 02, 2006
Posts: 8



(Msg. 1) Posted: Tue Jul 11, 2006 11:14 pm
Post subject: URL rewrite help - redirect complete URI
Archived from groups: alt>apache>configuration (more info?)

I want to dynamicaly generate pages for my domain name

for example,

I want to internally redirect
mydomain.com/company/new to mydomain.com/parse.php?value=/company/new
mydomain.com/anything to mydomain.com/parse.php?value=/anything

I want to redirect the complete URI and not any pattern.

Plz tell me hw do i form the redirect rule to implement this.

Thanks in advance.

 >> Stay informed about: URL rewrite help - redirect complete URI 
Back to top
Login to vote
frizzle

External


Since: May 11, 2005
Posts: 21



(Msg. 2) Posted: Wed Jul 12, 2006 3:55 am
Post subject: Re: URL rewrite help - redirect complete URI [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

arun.iit DeleteThis @gmail.com wrote:
> I want to dynamicaly generate pages for my domain name
>
> for example,
>
> I want to internally redirect
> mydomain.com/company/new to mydomain.com/parse.php?value=/company/new
> mydomain.com/anything to mydomain.com/parse.php?value=/anything
>
> I want to redirect the complete URI and not any pattern.
>
> Plz tell me hw do i form the redirect rule to implement this.
>
> Thanks in advance.

RewriteRule ^(parse\.php)$ - [L]
RewriteRule ^(.*)$ parse.php?value=$1 [L]

Wich would still allow you to request parse.php directly, wich still is
sort of a problem of mine as well ...

AFAIK it would be better to use index.php instead of parse.php, unless
parse.php is defined as default index page ... (i believe otherwise
you'd get an infinite loop)

Frizzle.

 >> Stay informed about: URL rewrite help - redirect complete URI 
Back to top
Login to vote
Arun

External


Since: Jul 12, 2006
Posts: 1



(Msg. 3) Posted: Wed Jul 12, 2006 5:22 am
Post subject: Re: URL rewrite help - redirect complete URI [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi frizzle

Thanks for the quick help.

I tried out that, but the $1 didnt have any content in it.
But then the redirection to parse.php worked.
So i just used the $_SERVER['REQUEST_URI'] variable to get the url of
the page requested. This has solved my problem.

Thanks again

Arun

frizzle wrote:
> arun.iit DeleteThis @gmail.com wrote:
> > I want to dynamicaly generate pages for my domain name
> >
> > for example,
> >
> > I want to internally redirect
> > mydomain.com/company/new to mydomain.com/parse.php?value=/company/new
> > mydomain.com/anything to mydomain.com/parse.php?value=/anything
> >
> > I want to redirect the complete URI and not any pattern.
> >
> > Plz tell me hw do i form the redirect rule to implement this.
> >
> > Thanks in advance.
>
> RewriteRule ^(parse\.php)$ - [L]
> RewriteRule ^(.*)$ parse.php?value=$1 [L]
>
> Wich would still allow you to request parse.php directly, wich still is
> sort of a problem of mine as well ...
>
> AFAIK it would be better to use index.php instead of parse.php, unless
> parse.php is defined as default index page ... (i believe otherwise
> you'd get an infinite loop)
>
> Frizzle.
 >> Stay informed about: URL rewrite help - redirect complete URI 
Back to top
Login to vote
frizzle

External


Since: May 11, 2005
Posts: 21



(Msg. 4) Posted: Wed Jul 12, 2006 5:29 am
Post subject: Re: URL rewrite help - redirect complete URI [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Arun wrote:
> Hi frizzle
>
> Thanks for the quick help.
>
> I tried out that, but the $1 didnt have any content in it.
> But then the redirection to parse.php worked.
> So i just used the $_SERVER['REQUEST_URI'] variable to get the url of
> the page requested. This has solved my problem.
>
> Thanks again
>
> Arun
>
> frizzle wrote:
> > arun.iit.TakeThisOut@gmail.com wrote:
> > > I want to dynamicaly generate pages for my domain name
> > >
> > > for example,
> > >
> > > I want to internally redirect
> > > mydomain.com/company/new to mydomain.com/parse.php?value=/company/new
> > > mydomain.com/anything to mydomain.com/parse.php?value=/anything
> > >
> > > I want to redirect the complete URI and not any pattern.
> > >
> > > Plz tell me hw do i form the redirect rule to implement this.
> > >
> > > Thanks in advance.
> >
> > RewriteRule ^(parse\.php)$ - [L]
> > RewriteRule ^(.*)$ parse.php?value=$1 [L]
> >
> > Wich would still allow you to request parse.php directly, wich still is
> > sort of a problem of mine as well ...
> >
> > AFAIK it would be better to use index.php instead of parse.php, unless
> > parse.php is defined as default index page ... (i believe otherwise
> > you'd get an infinite loop)
> >
> > Frizzle.

Not the $1 is a ONE, not a small L,
You could also use parse.php?value=%{REQUEST_URI}

Frizzle.
 >> Stay informed about: URL rewrite help - redirect complete URI 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
redirect german traffic with mod rewrite - Hello, I am wondering how those big sites like google redirect specific internet traffic. Is it possible to create a rewrite rool containing the german, austrian and swiz ip adresses and shift this traffic a german site? The only thing I found is..

mod rewrite - find word and redirect - How would I write a statement that will search the entire URL for a word or pattern and if found, redirect it? In other words if I wanted to search for the word 'monkey' anywhere in the url, whether as a parameter (like index.php?monkey) or..

Help needed - Mod Rewrite/redirect for subdomains - Hi, I'm in need of some assistance (read: please bail me out 'cos I'm really stuck!) My webhosts (www.1and1.co.uk) allow subdomains to be created so that for instance domain.co.uk/directory1 can be accessed through subdomain1.domain.co.uk..

Newbie: Wikipedia - rewrite redirect ??? - Hey, i have installed wikimedia on my local computer, now the pages are always like wiki/index.php?title=Mainpage how can i maked it like wikipedia that it looks like wiki/Mainpage? thanks, liss

rewrite rules (redirect all request to a single host) - sorry about this new message... i just noticed, that i messed up a running thread with the same subject. <font color=green> ; ;>> hi</font> <font color=green> ; ;>> </font> <font col...
   Web Hosting Problem Solving Community! (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 ]