Forum Moderators: phranque

Message Too Old, No Replies

rewrite problem - 500 internal error - anyone help?

article not showing, 500 internal error

         

jeremy910

10:45 am on Jul 25, 2012 (gmt 0)

10+ Year Member



Hi,
i have installed a module on a website, it said to include this in the htaccess file:


RewriteRule ^article(.*) /modules/prestapress/content.php [QSA,L]
RewriteRule ^articles(.*) /modules/prestapress/content.php [QSA,L]

and then i could go to my actual webpage at :

/article/1-Create-your-own-decking-area

and i get 500 Internal Server Error.

it already has RewriteEngine on ... above this by the way.

Thanks,
Jeremy

g1smd

11:27 am on Jul 25, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The second rule could NEVER run beacuse the first rule always matched the request.

The (.*) is redundant because you're not using the $1 capture it generates.

Do you have a file correctly loaded inside the server at
/modules/prestapress/content.php


Some other code is likely interfering with this.
This rewrite MUST be located after all of the redirects.

jeremy910

1:36 pm on Jul 25, 2012 (gmt 0)

10+ Year Member



hi.
no the page will not load at /modules/prestapress/content.php so theres obviously something wrong there before the mod rewite is taking over i assume.

not2easy

1:44 pm on Jul 25, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Do you have a .php handler, can you view .php pages? Basic question, I know, but I have seen hosts that do not have these basics enabled. If you upload a .php page and cannot view it I would contact the hosting provider for help with that.

jeremy910

1:47 pm on Jul 25, 2012 (gmt 0)

10+ Year Member



The whole site is php, as its database driven. All other pages are showing correctly, eg these rules work fine...

RewriteRule ^about/$ /cms.php?id_cms=4 [QSA,L,E]
RewriteRule ^contact/$ /contact-form.php [QSA,L,E]

just seems to be a problem with that particluar page. Very strange.

Thanks again.

lucy24

7:47 pm on Jul 25, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i have installed a module on a website, it said to include this in the htaccess file:

RewriteRule ^article(.*) /modules/prestapress/content.php [QSA,L]
RewriteRule ^articles(.*) /modules/prestapress/content.php [QSA,L]

Urk. I am horribly tempted to say that if the module designer's grasp of software design matches their grasp of mod_rewrite syntax, dump the module and look for a different one. In addition to everything g1 mentioned:

Out of all the rules you've quoted, only one needs the QSA flag:

RewriteRule ^about/$ /cms.php?id_cms=4 [QSA,L,E]

None of the others even mention a query string in the target, so any existing query would be (re)appended by default. Which, incidentally, would kinda defeat the point of rewriting, if the goal is to produce a shorter and prettier URL.

I also can't begin to imagine what that isolated [E] is supposed to be doing: it requires a variable name and, optionally, a value. In fact I would expect this omission alone to create a significant error. But apparently not.

Do you have access to your error logs? Different hosts set them to different levels-- you generally can't change it yourself in shared hosting-- but it's a start. Ignore all the lines that say "client denied by server configuration" (the basic 403 or [F] or Deny from), unless it's locking out people you didn't mean to lock out. Then see what else you find-- especially of course the 500-class errors.