Jump to content

.htaccess problem or somthing else


Recommended Posts

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 On
Rewrite 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.

Link to comment
https://forums.phpfreaks.com/topic/279448-htaccess-problem-or-somthing-else/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.