Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Rewrite mod problems

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  .htaccess prevent parent inherit  
Author Message
nospam189

External


Since: Nov 06, 2003
Posts: 2



(Msg. 1) Posted: Thu Nov 06, 2003 8:11 pm
Post subject: Rewrite mod problems
Archived from groups: alt>apache>configuration (more info?)

Hello,

I'm trying to use the rewrite engine on an apache 1.3 server running on
win2K.
I did some simple tests,showing the mod is well loaded.

My wish is to transform:

http://server/public/1024/fr/test.php

into

http://server/public/test.php?res=1024&lng=fr

I've tried with this little .htaccess:
#######################
RewriteEngine on
RewriteRule /public/([0-9]*)/([a-z]*)/(.*) /public/$3\?res=$1&lng=$2
#######################

But, I got a 404 error:
"The requested URL /public/1024/fr/test.php was not found on this server."

I read a lot of docs about this subject, but couldn't find anything helping
me.
I don't know why apache doesn't rewrite the URL.
Any help would be great.

Thanks for your replies.

Christian

 >> Stay informed about: Rewrite mod problems 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 2) Posted: Thu Nov 06, 2003 8:11 pm
Post subject: Re: Rewrite mod problems [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Christian wrote:

 > Hello,
 >
 > I'm trying to use the rewrite engine on an apache 1.3 server running on
 > win2K.
 > I did some simple tests,showing the mod is well loaded.
 >
 > My wish is to transform:
 >
<font color=purple> > <a style='text-decoration: underline;' href="http://server/public/1024/fr/test.php</font" target="_blank">http://server/public/1024/fr/test.php</font</a>>
 >
 > into
 >
<font color=purple> > <a style='text-decoration: underline;' href="http://server/public/test.php?res=1024&lng=fr</font" target="_blank">http://server/public/test.php?res=1024&lng=fr</font</a>>
 >
 > I've tried with this little .htaccess:
 > #######################
 > RewriteEngine on
 > RewriteRule /public/([0-9]*)/([a-z]*)/(.*) /public/$3\?res=$1&lng=$2

Try this:

RewriteEngine On
RewriteRule ^public/([0-9]+)/([a-z]+)/(.*) public/$3?res=$1&lng=$2
[L,NS,QSA]


 > I don't know why apache doesn't rewrite the URL.
 > Any help would be great.

Additionally, when you aren't sure what is happening, set the
RewriteLogLevel and RewriteLog to see if your patterns are being matched
and what else is going on.

--
Justin Koivisto - spam.DeleteThis@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Rewrite mod problems 
Back to top
Login to vote
user2545

External


Since: Nov 06, 2003
Posts: 2



(Msg. 3) Posted: Thu Nov 06, 2003 11:29 pm
Post subject: Re: Rewrite mod problems [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > Try this:
 >
 > RewriteEngine On
 > RewriteRule ^public/([0-9]+)/([a-z]+)/(.*) public/$3?res=$1&lng=$2
 > [L,NS,QSA]

Thank You, but it is still not working, always the same 404 error Sad

 >
  > > I don't know why apache doesn't rewrite the URL.
  > > Any help would be great.
 >
 > Additionally, when you aren't sure what is happening, set the
 > RewriteLogLevel and RewriteLog to see if your patterns are being matched
 > and what else is going on.

I already tried this, but every time, I got an internal error,
and in the error log, it says me that I don't have the
authorization to write, I tried a lot of various filename.
If you can tell me where to write a RewriteLog under win2K.

Again, thank you for your response.

Christian.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Rewrite mod problems 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 4) Posted: Thu Nov 06, 2003 11:29 pm
Post subject: Re: Rewrite mod problems [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Kriks wrote:

 > I already tried this, but every time, I got an internal error,
 > and in the error log, it says me that I don't have the
 > authorization to write, I tried a lot of various filename.
 > If you can tell me where to write a RewriteLog under win2K.

in httpd.conf I use:
<IfModule mod_userdir.c>
RewriteLogLevel 9
RewriteLog logs/rewrite.log
</IfModule>

Restart apache, then the file will appear in the same directory as the
error and access logs (assuming you didn't move them from their inital
resting places).

--
Justin Koivisto - spam RemoveThis @koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Rewrite mod problems 
Back to top
Login to vote
user2545

External


Since: Nov 06, 2003
Posts: 2



(Msg. 5) Posted: Fri Nov 07, 2003 2:16 am
Post subject: Re: Rewrite mod problems [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > in httpd.conf I use:
 > <IfModule mod_userdir.c>
 > RewriteLogLevel 9
 > RewriteLog logs/rewrite.log
 > </IfModule>

OK, I tried to put it in the .htaccess Wink
I will try this tomorrow.

 > Restart apache, then the file will appear in the same directory as the
 > error and access logs (assuming you didn't move them from their inital
 > resting places).

Thank you,
I'll give you news asap.

Christian<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Rewrite mod problems 
Back to top
Login to vote
nospam189

External


Since: Nov 06, 2003
Posts: 2



(Msg. 6) Posted: Fri Nov 07, 2003 1:18 pm
Post subject: Re: Rewrite mod problems [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

  > > in httpd.conf I use:
  > > <IfModule mod_userdir.c>
  > > RewriteLogLevel 9
  > > RewriteLog logs/rewrite.log
  > > </IfModule>
 >
 > OK, I tried to put it in the .htaccess Wink
 > I will try this tomorrow.

Yeah, it works and it really helped me to understand where the error was.
I was awaiting the "public/" to be in the URL, but it wasn't, as the
..htaccess is
in this directory. shame on me Smile)))))

A big thanks to you!!!

Christian<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Rewrite mod problems 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Mod Rewrite help - I've got 10,000+ files in a folder http://www.myseite.com/acrhives/ i.e. .../archives/2000/12/, .../archives/2000/11/, .../archives/2000/10/ ... Several years, many months of html mhonarc-archived docs. We have so many files in this one folder, I've..

REWRITE - I have a movie download site and what i need is that if users are linking my files (like http://www.eengoedidee.nl/videoz/bmx/jib.mpg) that they come to a page for the download. Like this..

url rewrite question - I'm just beginning to poke around in apache internals, so I want to check this before I try it. Problem: People who think my server is IIS and trying to get various *.exe and *.dll files in an attempt to compromise the server. The directory path used..

rewrite rule - Hi I want users of my site to be able to download video files, but only on specific conditions. To check these condition (to avoid hotlinking for example), I made a rewriterule: RewriteRule ([^.]*\.mpg) http://www2.tvreclames.nl/download.pl?file=$1 Fo...

ReWrite Problem - I am setting up a Zope Site (zope) behind an Apache Server. I have the ReWrite rule working correctly: <VirtualHost 10.0.0.12:80> <font color=purple> ; ServerName www.example.com</font> <font color=purple> ; Serve...
   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 ]