Results 1 to 2 of 2

Thread: redirecting url without .php ending

  1. #1
    Join Date
    Apr 2011
    Posts
    23
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default redirecting url without .php ending

    Hello,

    I'm having problems redirecting my url without the .php ending.
    This is the code what i'm using in my .htaccess:
    Code:
    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...

  2. #2
    Join Date
    Nov 2011
    Location
    Buenos Aires
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    you can use the function header(), check out the php manual

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •