Jump to content
sylvest

Debugging .htaccess

Recommended Posts

Hi,

 

I'm just starting to get to grips with the rewriting engine. I'm getting server "500" errors. Where does the rewriting engine write its log messages? Can I change this? Can I change the debug level? It doesn't seem to accept RewriteLog or RewriteLogLevel commands in the .htaccess file.

 

Can you suggest any otehr ways of finding out what's happening while it's processing my .htaccess file?

 

Thanks - Rowan

Share this post


Link to post
Share on other sites

Usually a "500" error usually denotes a permissions problem. Since the server is doing the writing the file requires read/write access for everyone (ie: 666). And make sure the file if uploaded was uploaded in ASCII mode and not Binary.

Share this post


Link to post
Share on other sites

Thanks for your suggestion. Do you mean the permissions of the .htaccess file? It was 644. I've changed it to 666 but it makes no difference to the 500 error.

 

In any case, why would the server be _writing_ to the .htaccess file?

 

Thanks - Rowan

Share this post


Link to post
Share on other sites

Is it not possible to get some logging from mod-rewrite? That would make it so much easier! Otherwise I'm reduced to trying things at random and hoping that eventually one of them will work...

 

Thanks - Rowan

Edited by sylvest

Share this post


Link to post
Share on other sites

It doesn't seem to accept RewriteLog or RewriteLogLevel commands in the .htaccess file.

 

Can you suggest any otehr ways of finding out what's happening while it's processing my .htaccess file?

 

These directives are not allowed in .htaccess, please see httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog . Most errors will show up in your cPanel under Logs > Error Log, if you are not able to find an issue there you will need to open a ticket.

Share this post


Link to post
Share on other sites

The times I have experienced 500 internal server errors is when I have syntax errors within the .htaccess file itself.

 

If you want, send me the .htaccess file you are using and I will see if I can work out what is wrong. Not saying I am an expert, but I do work with them on a daily basis at work.

Share this post


Link to post
Share on other sites

In any case, why would the server be _writing_ to the .htaccess file?

Maybe I misunderstood your issue. No, do not set your .htaccess file to 666 permissions.

Share this post


Link to post
Share on other sites

The times I have experienced 500 internal server errors is when I have syntax errors within the .htaccess file itself.

 

If you want, send me the .htaccess file you are using and I will see if I can work out what is wrong. Not saying I am an expert, but I do work with them on a daily basis at work.

That's a fine offer, thanks. I may do this if I get desperate, but a better solution would be for me to have the tools needed to debug these issues myself. I'm beginning to have a bit of success by adding some rewrite rules to report the values of variables etc. in the returned headers. Very tedious but better than no visibility at all...

 

For the moment I'm struggling on with trying to understand how all this works and get it right...

 

Rowan

Share this post


Link to post
Share on other sites

but a better solution would be for me to have the tools needed to debug these issues myself.

 

Unfortunately that type of access is not provided in a shared environment as it just results in problems for other users.

 

If you continue to have issues, feel free to open a ticket with the help desk. Short of trying to use htaccess to host more than one site, which is a TOS violation, we will gladly assist with any rewrite issues.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...