hi, i am new to php and trying to rewriting with htaccess this is what i am doing
RewriteEngine on
RewriteRule ^index\.php$ index
just trying to show "index" when "index.php" is written in url and i am getting the error 500
i dont know it is a configuration problem or i am not writing incorrectly please help me in this
[edit] this error is coming if i just try to redirects a page, this is what i am doing
Redirect index.php http://localhost/shopping/cart.php
and apachi log file is createing the following error
[Fri Jan 27 15:24:21 2006] [alert] [client 127.0.0.1] c:/program files/easyphp1-8/www/shopping/.htaccess: Invalid command '\xff\xfeR', perhaps mis-spelled or defined by a module not included in the server configuration
i have already uncomment following lines in config files
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c
rewriting with htaccess
Moderator: General Moderators
thanks for the post shiflett. that problem is solved i was not saving file as asci but as unicode but now i am facing a new one i am writing the same code for rewriting the url and when i open the page on localhost it redirects me insted of rewtiting and if i am not giving the name of page it assums it a directory as in the following case. could someone please tell me that i am doing wrong i just want to display "index" whenever index.php is called.. here is the code again
RewriteEngine on
RewriteRule ^index\.php$ index
i am using apache 2 and php 5
RewriteEngine on
RewriteRule ^index\.php$ index
i am using apache 2 and php 5
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
If you want the url in the go bar to change like a header redirect you need a R flag
Code: Select all
RewriteRule original rewritten.php [R]