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

mod-rewrite

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Tomcat 4.0.6  
Author Message
hlax

External


Since: Nov 20, 2003
Posts: 2



(Msg. 1) Posted: Thu Nov 20, 2003 4:10 am
Post subject: mod-rewrite
Archived from groups: alt>apache>configuration (more info?)

I am attempting to use mod-rewrite to chnage my dynamically created pages
into static urlls for search engine submission. I am unable to get the
rewrite to work, it doesn't seem to do anything.

Here is the code

RewriteEngine on
RewriteBase /home/mydirpublic_html/show/
RewriteRule ^productid([^.]+).*$ Theatres.php?id=$1
[T=application/x-httpd-php]

In the calling html file I call productid1.htm

What am I doing wrong?

I using shared hosting so my directory is noit the root. I have been
auinable to get logging to work and each time I try to add loggin to the
..htaccess file I get an error when trying to viw the calling page.

 >> Stay informed about: mod-rewrite 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 2) Posted: Thu Nov 20, 2003 5:32 pm
Post subject: Re: mod-rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Harlan Lax wrote:

 > I am attempting to use mod-rewrite to chnage my dynamically created pages
 > into static urlls for search engine submission. I am unable to get the
 > rewrite to work, it doesn't seem to do anything.
 >
 > Here is the code
 >
 > RewriteEngine on
 > RewriteBase /home/mydirpublic_html/show/

This shouldn't be the system path, but the URI from doc_root. For
instance, if your site is located at <a style='text-decoration: underline;' href="http://www.example.com/~username" target="_blank">http://www.example.com/~username</a>
and the directory you want to use rewrite in is
<a style='text-decoration: underline;' href="http://www.example.com/~username/show/" target="_blank">http://www.example.com/~username/show/</a> then you'd want to use the following:
RewriteBase /~username/show/

Alternatively, you can skip the RewriteBase althogether if your
..htaccess file is in the show directory.

 > RewriteRule ^productid([^.]+).*$ Theatres.php?id=$1
 > [T=application/x-httpd-php]

RewriteRule ^productid(.*)\.html?$ Theatres.php?id=$1

That should have the following results:
product1.html => Theatres.php?id=1
product1.htm => Theatres.php?id=1
product1054.html => Theatres.php?id=1054
product13.54.html => Theatres.php?id=13.54
product-a1.html => Theatres.php?id=-a1

--
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: mod-rewrite 
Back to top
Login to vote
hlax

External


Since: Nov 20, 2003
Posts: 2



(Msg. 3) Posted: Fri Nov 21, 2003 1:18 am
Post subject: Re: mod-rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for such a good explaination. Unfortunately when I put the .htaccess
filein the directory I get the following error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, and inform them of the time the
error occurred, and anything you might have done that may have caused the
error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.

Any idea on how to debug this?



"Justin Koivisto" <spam DeleteThis @koivi.com> wrote in message
news:3g4vb.1075$Uz.33673@news7.onvoy.net...
 > Harlan Lax wrote:
 >
  > > I am attempting to use mod-rewrite to chnage my dynamically created
pages
  > > into static urlls for search engine submission. I am unable to get the
  > > rewrite to work, it doesn't seem to do anything.
  > >
  > > Here is the code
  > >
  > > RewriteEngine on
  > > RewriteBase /home/mydirpublic_html/show/
 >
 > This shouldn't be the system path, but the URI from doc_root. For
<font color=purple> > instance, if your site is located at <a style='text-decoration: underline;' href="http://www.example.com/~username</font" target="_blank">http://www.example.com/~username</font</a>>
 > and the directory you want to use rewrite in is
 > <a style='text-decoration: underline;' href="http://www.example.com/~username/show/" target="_blank">http://www.example.com/~username/show/</a> then you'd want to use the
following:
 > RewriteBase /~username/show/
 >
 > Alternatively, you can skip the RewriteBase althogether if your
 > .htaccess file is in the show directory.
 >
  > > RewriteRule ^productid([^.]+).*$ Theatres.php?id=$1
  > > [T=application/x-httpd-php]
 >
 > RewriteRule ^productid(.*)\.html?$ Theatres.php?id=$1
 >
 > That should have the following results:
 > product1.html => Theatres.php?id=1
 > product1.htm => Theatres.php?id=1
 > product1054.html => Theatres.php?id=1054
 > product13.54.html => Theatres.php?id=13.54
 > product-a1.html => Theatres.php?id=-a1
 >
 > --
 > 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: mod-rewrite 
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..

Mod rewrite problem - is it possible to use this rewrite rule to call a cgi script: RewriteRule ^xredirect:(.+) /path/to/redirect.cgi/$1and when the redirect.cgi script gets the request, decline it so that another rewrite rule could be used or the document orignally called..

Rewrite mod problems - 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 ..

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..
   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 ]