Mod_rewrite, small problem

This is a discussion on Mod_rewrite, small problem within the Apache Web Server forums, part of the Web Server and Related Forums category; Greetings, I have a small problem with mod_rewrite. The rewriting works well, when a user calls http://mywebsite/home.html ...


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 12-04-2006
Ldesert
 
Posts: n/a
Default Mod_rewrite, small problem

Greetings,

I have a small problem with mod_rewrite.
The rewriting works well, when a user calls http://mywebsite/home.html
the serve returns well "http://mywebsite/index.php?p=home".
My problem is that the adress bar shows
"http://mywebsite/index.php?p=home" when I'd like it to show
"http://mywebsite/home.html".
How can I get around this ?

Thanks in advance Folks,

Ludovic

  #2 (permalink)  
Old 12-04-2006
HansH
 
Posts: n/a
Default Re: Mod_rewrite, small problem

"Ldesert" <ludovic.desert@gmail.com> schreef in bericht
news:1165238727.407296.215030@j44g2000cwa.googlegr oups.com...
> The rewriting works well, when a user calls http://mywebsite/home.html
> the serve returns well "http://mywebsite/index.php?p=home".
> My problem is that the adress bar shows
> "http://mywebsite/index.php?p=home" when I'd like it to show
> "http://mywebsite/home.html".
> How can I get around this ?
>

I hope my cristal ball still works ...
.... drop the [R] flag on your rewriterule.

HansH


  #3 (permalink)  
Old 12-04-2006
shimmyshack
 
Posts: n/a
Default Re: Mod_rewrite, small problem

ha nice one!

  #4 (permalink)  
Old 12-04-2006
HansH
 
Posts: n/a
Default Re: Mod_rewrite, small problem

"shimmyshack" <matt.farey@gmail.com> schreef in bericht
news:1165239987.761998.57730@79g2000cws.googlegrou ps.com...
> ha nice one!

Not nice is your habbit to not quote the part of the previous post you're
reflecting to.
It makes reading a thread very hard for those not using a web frontend.

HansH


  #5 (permalink)  
Old 12-04-2006
shimmyshack
 
Posts: n/a
Default Re: Mod_rewrite, small problem


HansH wrote:
> "shimmyshack" <matt.farey@gmail.com> schreef in bericht
> news:1165239987.761998.57730@79g2000cws.googlegrou ps.com...
> > ha nice one!

> Not nice is your habbit to not quote the part of the previous post you're
> reflecting to.
> It makes reading a thread very hard for those not using a web frontend.
>
> HansH


point taken, thanks for the heads-up

  #6 (permalink)  
Old 12-05-2006
Ldesert
 
Posts: n/a
Default Re: Mod_rewrite, small problem

Well thanks for the answer Hans buuuuut unfortunatly it doesn't work.
My htaccess is as follows :

------begin-------
RewriteEngine on
RewriteRule ^([a-z]+)\.html$
http://mywebsite.com/myFolder/index.php?p=$1
--------end ----------

and still the adress bar shows "http://mywebsite/index.php?p=home"
when I'd like it to show
"http://mywebsite/home.html".

help ? :)


HansH a écrit :

> "Ldesert" <ludovic.desert@gmail.com> schreef in bericht
> news:1165238727.407296.215030@j44g2000cwa.googlegr oups.com...
> > The rewriting works well, when a user calls http://mywebsite/home.html
> > the serve returns well "http://mywebsite/index.php?p=home".
> > My problem is that the adress bar shows
> > "http://mywebsite/index.php?p=home" when I'd like it to show
> > "http://mywebsite/home.html".
> > How can I get around this ?
> >

> I hope my cristal ball still works ...
> ... drop the [R] flag on your rewriterule.
>
> HansH


  #7 (permalink)  
Old 12-05-2006
HansH
 
Posts: n/a
Default Re: Mod_rewrite, small problem

"Ldesert" <ludovic.desert@gmail.com> schreef in bericht
news:1165310439.421943.182640@j72g2000cwa.googlegr oups.com...
> > The rewriting works well, when a user calls http://mywebsite/home.html
> > the serve returns well "http://mywebsite/index.php?p=home".
> > My problem is that the adress bar shows
> > "http://mywebsite/index.php?p=home" when I'd like it to show
> > "http://mywebsite/home.html".
> > How can I get around this ?
> >

> I hope my cristal ball still works ...
> ... drop the [R] flag on your rewriterule.
>
> My htaccess is as follows :
> RewriteEngine on
> RewriteRule ^([a-z]+)\.html$
> http://mywebsite.com/myFolder/index.php?p=$1


Test for me
RewriteEngine on
RewriteRule ^([a-z]+)\.html$ index.php?p=$1

HansH


  #8 (permalink)  
Old 12-05-2006
Ldesert
 
Posts: n/a
Default Re: Mod_rewrite, small problem

yoohoo!! it works!
well it works when I put this rule :

RewriteEngine on
RewriteRule ^([a-z]+)\.html$ /myFolder/index.php?p=$1

A big big thank you Hans!
Have a pleasant day!

HansH a écrit :

> "Ldesert" <ludovic.desert@gmail.com> schreef in bericht
> news:1165310439.421943.182640@j72g2000cwa.googlegr oups.com...
> > > The rewriting works well, when a user calls http://mywebsite/home.html
> > > the serve returns well "http://mywebsite/index.php?p=home".
> > > My problem is that the adress bar shows
> > > "http://mywebsite/index.php?p=home" when I'd like it to show
> > > "http://mywebsite/home.html".
> > > How can I get around this ?
> > >

> > I hope my cristal ball still works ...
> > ... drop the [R] flag on your rewriterule.
> >
> > My htaccess is as follows :
> > RewriteEngine on
> > RewriteRule ^([a-z]+)\.html$
> > http://mywebsite.com/myFolder/index.php?p=$1

>
> Test for me
> RewriteEngine on
> RewriteRule ^([a-z]+)\.html$ index.php?p=$1
>
> HansH


 
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 05:30 PM.


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