Log in

View Full Version : redirecting url without .php ending



X-Tream
10-29-2011, 05:45 PM
Hello,

I'm having problems redirecting my url without the .php ending.
This is the code what i'm using in my .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
Basically it's the same as the normal one, but it adds a "/" in the end of the url. (For example http://website.com/example.php shows like http://website.com/example/, but i guess every one of you know that all ready (: )

Anyway the problem what i'm having is that before i added that code (in my .htaccess) my forum worked by using a url "http://netti-tv.net/keskustelu", but not anymore... :/ It goes straight to my notfound.php page...

How can I get that url working again? For now the only way to get to my forum ( running phpbb3 ) is by going to http://netti-tv.net/keskustelu/index.php

I would really appreciate if some one could help me...Sorry for my bad English...

csscoder
11-01-2011, 03:25 AM
you can use the function header(), check out the php manual