2

I have a QNAP NAS with Apache correctly installed. Some pages are linking fine except for ones using any RewriteRule. All other pages are linking correctly to mysql and displaying fine its the ones with any RewriteRule, these are showing up as a 404 error like this:

The requested URL /share/CACHEDEV1_DATA/Web/clients/hembury4x4/couk/view-sitemap.php was not found on this server.

URL = http://192.168.1.210/Web/clients/clientname/sitemap.html

FILE= http://192.168.1.210/Web/clients/clientname/view-sitemap.php

My rule is quite simply: RewriteRule ^sitemap.html$ view-sitemap.php [NC,L]

I have copied all the site files from my computer where the redirect was working perfectly. What do i need to add on my htaccess file?

Thanks in advance

David G
  • 301
  • 3
  • 14

1 Answers1

1

First, apache should have rewrite module. It should present in the output of httpd -M command.

Then you should allow .htaccess files. This can be made by adding AccessFileName .htaccess directive (if it's absent) to your httpd.conf file. Also check you have this section:

<Directory />
    AllowOverride All
</Directory>
umka
  • 1,655
  • 1
  • 12
  • 18
  • I have now added the code you specified but im getting a '500 Internal Server Error' instead. This was placed before any of my rules and after "Options +FollowSymlinks Options -Indexes RewriteEngine on" – David G May 28 '15 at 15:52
  • I have slightly updated my answer. If you got an error, look to error_log to find what causes it. – umka May 28 '15 at 16:06
  • Can you provide some valid and invalid sample inputs in your question? – anubhava May 28 '15 at 16:26