0

I have just transferred a website over to a new server and now the .htaccess file redirects do not seem to be working. Please see below for an example:

# .htaccess

#Rewrite rules
RewriteEngine on
Options +FollowSymlinks
RewriteBase /weddings/

RewriteRule ^facilities facilities.php [NC]

RewriteRule ^catering catering.php [NC]
RewriteRule ^gallery/([^/]+) ../general/gallery.php?gal=$1 [NC]
RewriteRule ^gallery ../general/gallery.php [NC]
RewriteRule ^location ../general/location.php [NC]
RewriteRule ^floor_plans ../general/floor_plans.php [NC]
RewriteRule ^testimonials ../general/testimonials.php [NC]
RewriteRule ^prices ../general/prices.php [NC]
RewriteRule ^parking ../general/parking.php [NC]
RewriteRule ^accommodation ../general/accommodation.php [NC]

Any suggestions to why this could be?

Thanks

user2695578
  • 11
  • 1
  • 1
  • 2

1 Answers1

0

Make sure you enabled .htaccess. Somewhere in your Apache config, you should have

AllowOverride All

Also make sure mod_rewrite is installed and enabled. In Debian, symlink /etc/apache2/mod-enabled/rewrite.load should point to ../mods_available/rewrite.load. Otherwise see How to enable mod_rewrite for Apache 2.2.

Community
  • 1
  • 1
Palec
  • 12,743
  • 8
  • 69
  • 138
  • Hi Palec,I am unable to find a Apache config file? – user2695578 Jan 06 '14 at 16:49
  • @user2695578 I assume you are using Linux. It should be in `/etc`, probably `/etc/apache2`. What distro do you use? – Palec Jan 06 '14 at 16:51
  • The website and admin area was bespokely made by someone else (who I do not know) there is no etc folder I have tried doing a search file too – user2695578 Jan 06 '14 at 16:53
  • @user2695578 I did not speak about DocumentRoot. `/etc` is filesystem path, `etc` directory in the server filesystem root. – Palec Jan 06 '14 at 16:55
  • Sorry Palec I have now found the etc folder but there the file isn't in there. Do you think this is something I should take up with my host? – user2695578 Jan 06 '14 at 16:58
  • @user2695578 What file is not there? The `/etc/apache2` directory? If you cannot change the server config, you need to solve the problem with somebody who can. If you want to be sure that `.htaccess` is completely disabled, you can try creating a parse error in your `.htaccess`. If you do not get 500 error at each page in the same directory, then `.htaccess` is disabled. – Palec Jan 06 '14 at 17:24
  • The httpd.conf is not there nor the apache2 directory. I have made a mistake in the .htaccess file and I do not get a 500 error – user2695578 Jan 06 '14 at 17:36
  • @user2695578 See http://stackoverflow.com/q/4111682/2157640 and http://stackoverflow.com/q/15956131/2157640. As I wrote, you have to contact someone who can help you with server configuration. `.htaccess` is just a part of it and in your case it is obviously disabled. – Palec Jan 06 '14 at 17:49
  • @user2695578 Anyway, I think my answer deserves to be accepted. I pointed you to the right direction, explicitly answered your question (“Any suggestions on why this could be?”) and finally we tracked down the problem. Now it is up to your host. I believe that after you enable `.htaccess`, your site will work OK. – Palec Jan 06 '14 at 17:55