Jump to content

.htaccess problem or somthing else


Go to solution Solved by kicken,

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.