adv Posted April 15, 2008 Share Posted April 15, 2008 hello sorry if i posted in a wrong section... here`s my problem i`ve installed apache i`ve installed also the modules and enable mod_rewrite.so it works if the files are in /var/www/html i can do http://server.com/index but if i change the DocumentRoot to another folder it doesn`t work without extension i say the file is not found :| any help will be apreciated edit : sorry i posted several days ago in another section but no answer .. :| Quote Link to comment Share on other sites More sharing options...
ucffool Posted April 15, 2008 Share Posted April 15, 2008 can you put the rewrite rules in an .htaccess file in the directory in question? Quote Link to comment Share on other sites More sharing options...
adv Posted April 15, 2008 Author Share Posted April 15, 2008 i didn`t created the .htaccess.. do i need it to put in the new DocumentRoot that i have created ? and how does it works ..i only what to use the site without the extentions . Quote Link to comment Share on other sites More sharing options...
ucffool Posted April 15, 2008 Share Posted April 15, 2008 You would have an .htaccess file in the document root with something like: Options +FollowSymLinks RewriteEngine on # Change all URLs that contain letters and numbers only to TheTarget.php RewriteRule ([0-9a-z]+)$ $1.php [QSA,L] Note, I haven't tested the above code, but it should work (or I'm sure someone else will correct me) Quote Link to comment Share on other sites More sharing options...
adv Posted April 16, 2008 Author Share Posted April 16, 2008 Not Found The requested URL /php.php was not found on this server. i just want to get rid of the extension .. to be seen only the index not index.php in the DocumentRoot Quote Link to comment Share on other sites More sharing options...
ucffool Posted April 16, 2008 Share Posted April 16, 2008 go to server.com/index and it should try and grab /index.php Quote Link to comment Share on other sites More sharing options...
adv Posted April 16, 2008 Author Share Posted April 16, 2008 i`ve done it thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.