1

I know there are a few of (probably) the same questions out there, but I just can't find any working solution.

I've placed the .htaccess file next to my index.php on the server. And even if the .htaccess is empty the site returns error 403 (forbidden access).

What I wanted to do is remove the .php extension.

http://foo.net/web_new/index_1024.php

And even if I put the following into the .htaccess, the website still returns error 403.

<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   RewriteEngine on 
   RewriteCond %{REQUEST_FILENAME} !-d 
   RewriteCond %{REQUEST_FILENAME}\.php -f 
   RewriteRule ^(.*)$ $1.php
</IfModule>

I've found on the web, to enable the mod_rewrite, I should enable it in httpd.conf. But I search the whole server (ftp), but there is no clue.

where phpinfo() finds conf.d file

/etc/php5/conf.d

where is my root

/srv/www/web6/

Any idea, what could i do?

Sebastjan
  • 1,117
  • 2
  • 17
  • 24
  • If you remove the .htaccess and just have a normal index.html page in your web folder does it 403? – Keeleon Mar 05 '13 at 14:35
  • Do you have any other sites under that web root? – Schoffelman Mar 05 '13 at 14:38
  • I guess you rented your webspace and do not actually own the server? Are you able to change into the /etc/php5/conf.d folder from your FTP client? Do you have SSH access? If not, then there's no way for you to change the httpd.conf file, you will have to ask the server owner/your provider. – chrki Mar 05 '13 at 14:44
  • If i remove .htaccess file, the site works as it should :). There are no any other sites in the web_new folder. Yes the server is rented. And the deepest i can get on the server is srv/www/web6 – Sebastjan Mar 05 '13 at 15:12

1 Answers1

2
  1. Make sure that .htaccess has 644 permissions
  2. I think you can remove that ifModule... I find it "messy" there...
  3. Your code looks well...
Alex
  • 2,126
  • 3
  • 25
  • 47
  • Alex, thank you for your answer. .htaccess permissions are already set to 644, and I also removed – Sebastjan Mar 05 '13 at 16:50
  • check if you enabled mod_rewrite stuff... you have to uncomment something or add some lines somewhere... – Alex Mar 05 '13 at 17:57