Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Posts
    131
    Thanks
    28
    Thanked 7 Times in 7 Posts

    Website displays folder instead of the actual page

    First off - SORRY, if this isn't an appropiate section for my issue. There's a bit PHP in it, but it's mainly based on my .htaccess along with URL rewriting, I guess. But at the same time, I really need to get this solved as soon as possible.

    So I have rewritten my URLs in my htaccess file. When I go to www.mysite.com/forum I want it to load the contents from index.php?page=forum

    Although! Instead it loads the folder called forum/ in my root folder. So I would actually have to change the ?page value or change the folder name.

    Isn't there a work around for this in my .htaccess file perhaps?
    The rewriting in my .htaccess looks like this:

    Code:
    RewriteRule ^([a-zA-Z0-9]+)$ index.php?page=$1
    Last edited by [vengeance]; 09-11-2009 at 10:37 PM.

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    are you sure that rewriting is enabled?

  • #3
    Regular Coder
    Join Date
    Aug 2009
    Posts
    131
    Thanks
    28
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by angst View Post
    are you sure that rewriting is enabled?
    Yes, yes it is.

    Code:
    RewriteEngine On
    // Rewrite stuff here including the code posted on the first post.

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    right, but just because you put "RewriteEngine On" doesn't mean that it's installed and working.

  • #5
    Regular Coder
    Join Date
    Aug 2009
    Posts
    131
    Thanks
    28
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by angst View Post
    right, but just because you put "RewriteEngine On" doesn't mean that it's installed and working.
    Well, it works for any other page - but not for the forum/ somehow, because I have a folder called the same.

  • #6
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    ah ok, I'm not sure if theres a work around for that, it might be simpler to just change the folder or link name.

  • #7
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts
    This is more of an .htaccess issue than a php one but I will try to help. .htaccess is a great tool but can be very frustrating. My guess is that if there is a folder named that then it is most likely the cause because it normally only goes to the mod_rewrite if the requested file or folder is not found. So you may try either changing the folder name or the script name. Just a thought.

    ...Like angst just suggested...

  • #8
    Regular Coder
    Join Date
    Aug 2009
    Posts
    131
    Thanks
    28
    Thanked 7 Times in 7 Posts
    Well yeah, I got frustrated about it and simply changed the folder name. It works now.


  •  

    Posting Permissions

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