MarioApprentice Posted June 22, 2013 Share Posted June 22, 2013 Hello to everyone. I'm making seo friendly urls and i have a problem on localhost apache. this is my url for my page localhost/firstFolder/secondFolder/index.php and in the last folder, the htaccess resides with the following code RewriteEngine OnRewrite rule ^([a-zA-Z/]+)/$ index.php Everytime i try to access index.php in 'secondFolder', the server says 'Server Error, error 500'. I checked what error 500 means and its a general 'fit all' error so that didn't help. I tried puttin .htaccess in some other folder, but everytime the server sees the file, he throws error 500 no matter where i put the file. Is it a syntax error? This is basicily copy/paste code and i doubt it. Any help is welcome. Quote Link to comment https://forums.phpfreaks.com/topic/279448-htaccess-problem-or-somthing-else/ Share on other sites More sharing options...
Solution kicken Posted June 22, 2013 Solution Share Posted June 22, 2013 Rewrite rule ^([a-zA-Z/]+)/$ index.php The proper format is RewriteRule, one word, no space. Quote Link to comment https://forums.phpfreaks.com/topic/279448-htaccess-problem-or-somthing-else/#findComment-1437369 Share on other sites More sharing options...
MarioApprentice Posted June 22, 2013 Author Share Posted June 22, 2013 (edited) yea, i just found that out. I should search more before i ask in here. Thank you. Edited June 22, 2013 by MarioApprentice Quote Link to comment https://forums.phpfreaks.com/topic/279448-htaccess-problem-or-somthing-else/#findComment-1437371 Share on other sites More sharing options...
MarioApprentice Posted June 22, 2013 Author Share Posted June 22, 2013 now a related problem that i really can't solve im trying url rewrite with .htaccess and can't seem to make it work. my code is mainly copy/paste but i have some experience with regular expressions. this is my code in .htaccess RewriteRule ^FictionalFolderName/([a-zA-Z/]+)/$ index.php I would like to replace index.php and any file that has .php extension with 'FictionalFolderName' but i get errors. Also, i can't get it to work with parameters either. I would like to have it like this localhost/FolderName/FictionalFolderName/ParamaterValue/ but this doesn't seem to work. RewriteRule ^FictionalFolderName/([a-zA-Z/]+)/$ index.php?name=$1 Thank you for your help. And please, don't just give me a solution. I would like to understand this so I don't have to come here for answers. Quote Link to comment https://forums.phpfreaks.com/topic/279448-htaccess-problem-or-somthing-else/#findComment-1437374 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.