0

My magento store has this in the htaccess:

## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

I would like to log what is going on in my htaccess process. I have tried adding this code:

RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 2

But I'm getting an "Internal Server Error" or a Not Found erro when run it with the RewriteLog lines.

Any tips / help?

Thanks!

MiguelR
  • 151
  • 2
  • 14
  • You can’t use `RewriteLog` and `RewriteLogLevel` in .htaccess files. – Gumbo Oct 14 '12 at 10:29
  • Set log file from httpd.conf, you can activate debbuging in your store to know what is doing magento behind. Check this http://www.redlightblinking.com/blog/magento-tutorials/magento-debugging-how-to-debug-template-paths-logging-and-display-errors – Mariano Montañez Ureta Oct 14 '12 at 10:45
  • Gumbo: What can I do then? I am in a GoDaddy Linux server and I don't think I have access to the httpd.conf. MMU: The store debugging is useful, but not in this case as the problem is on the server side (before Magento). – MiguelR Oct 14 '12 at 17:07
  • Try http://blog.tolleiv.de/2010/01/debugging-mod_rewrite/ or http://www.latenightpc.com/blog/archives/2007/09/05/a-couple-ways-to-debug-mod_rewrite – MagePal Extensions Oct 14 '12 at 17:12

1 Answers1

1

As mentioned before you can't turn on the rewrite log from inside htaccess files, and since you're in GoDaddy's walled garden, there's not much you can do.

Any tips / help?

Create an offline test server:

  1. Find a linux machine or install one in virtualbox on your windows machine.
  2. Install apache
  3. Install php or whatever other modules magento needs
  4. Move your entire website to your /var/www/localhost/htdocs directory (or whereever the document root is)
  5. In apache's config, turn on rewrite log
  6. go to http://localhost/your-site and see what the log says.
Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • exactly, and don't fall for "the easy way" using some tricks to see a variable. I just wasted a lot of time that way: http://stackoverflow.com/questions/9153262/tips-for-debugging-htaccess-rewrite-rules/#41908462 – papo Jan 28 '17 at 10:02