Hi I have a .htaccess file tested on many different servers. Up to now everything was fine. On a new server installation I get an error The requested URL /home/site/public_html/index.php was not found on this server. (Calling url is 192.168.2.200/~site/en/) Infact the file exists but there is some thing missing in the path. It should be /usr/home/site/public_html/index.php More information: -------------- Site is hosted at 192.168.2.200/~site/ User director in the file system is /usr/home/site System: FreeBSD est.abegp.gov.tr 6.4-RELEASE FreeBSD 6.4-RELEASE #0: Wed Nov 26 08:37:42 UTC 2008 root@palmer.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP amd64 Server API: Apache 2.0 Handler .htacces file part: RewriteEngine on DirectoryIndex index.html index.php Options -Indexes RewriteRule ^([a-z]{2})/?$ index.php?lang=$1&
OK... I have too many rules like "RewriteRule ^([a-z]{2})/?$ index.php?lang=$1& " in .htaccess file. instead of adding /usr/home/site/public_html/ before file names of all rules, is there any easy way of doing this? for example adding a last rule at the end of the file that adds this path to files.
before your rewrite rules add the line RewriteBase / that would be server document root for your web site if you have your .htaccess in a subfolder /sub/subfolder2/ then you have to adjust accordingly i.e.:something like RewriteBase /sub/subfolder2/
Thanks for the replies, but problem goes on. I've changed rewritebase now this error comes out: /usr/home/site/public_html/index.php was not found on this server. I know that the file exists there. When I login with filezilla through ssh Remote Site window is /usr/home/site/public_html/ and index.php is there any ideas???
here below on apache 2.2 opensuse the code I had to add before each rewrite line in my htaccess Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase /