Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Redirects not playing nice

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #188658
    CameronDuthie
    Participant

    Hi there,

    I’ve just not long finished a site build here.

    It’s a php site that uses perch as a cms, after i finished putting the site together i wanted to get rid of the file extensions in the URLs.

    Naturally, i used a redirect in my .htaccess file which seemed to work fine and dandy until i tried to view one page, being this one where i get a very helpful note stating that i’m “Forbidden – You do not have permission to access this document.”

    I’ve checked my permissions with the server and it appears that i do in fact have full permissions for that page.

    Would anyone know why i apparently don’t have permissions for that page or why the re-direct doesn’t appear to be working when it works perfectly fine for every other page?

    For example this works fine,

    http://miller-business.com/charities

    http://miller-business.com/charities.php

    But this doesn’t,

    http://miller-business.com/coaching

    http://miller-business.com/coaching.php

    Here’s a peek at my rewrite rule,

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME}.php -f
        RewriteRule ^(.*)$ $1.php
    </IfModule>

    Any help would be greatly appreciated.

    Many thanks! :)

    #188664
    Alen
    Participant

    Try this:

    
    Options -MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.php [NC,L]
    
    #188665
    CameronDuthie
    Participant

    Thanks for getting back to me Alen. :)

    Unfortunately that didn’t work.

    It’s the darndest thing, i’ve even tried creating a new page under ‘coaching-1.php’ (which works like all the other pages) then deleting the old ‘coaching’ page then changing the new file name to ‘coaching’.

    It’s almost like the server doesn’t like the word ‘coaching’ or something…

    #188666
    CameronDuthie
    Participant

    Thanks for getting back to me Alen. :)

    Unfortunately that didn’t work.

    It’s the darndest thing, i’ve even tried creating a new page under ‘coaching-1.php’ (which works like all the other pages) then deleting the old ‘coaching’ page then changing the new file name to ‘coaching’.

    It’s almost like the server doesn’t like the word ‘coaching’ or something…

    #188667
    Alen
    Participant

    Do you have a folder under the same name? I see that it keeps adding forward slash which it should not be happening.

    #188670
    __
    Participant

    Do you have a folder under the same name?

    my thought as well.

    #188690
    CameronDuthie
    Participant

    Guys, thank you so much. That’s exactly what is was…feel so stupid now.

    Thanks again! :)

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.