Search
Left Quote    I think there is a world market for maybe five computers.
- Thomas Watson, Chairman of IBM 1943    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Mod rewrite folders
  This user is offline  AdRock
  Subject: "Mod rewrite folders" Posted: @ 11:01 pm on Nov 21 2006   
Member #: 186
Rank: User - (31)
Since: 07/21/06
Posts: 31
From: Devon

I have been having trouble with mod rewrite for ages.

I have a sub directory in the root directory called admin and in the admin directory i have an index.php page.

The trouble I'm having is when i use www.mydomain.co m/admin/ it's not displaying the index page within the admin directory but the index page within the root directory.
Any ideas why it's doing this?


Code:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Za-z0-9\-_ ]+)/?$ index.php?page= $1
RewriteRule ^gallery/([A-Za -z0-9\-_]+)/([0 -9]+)/?$ index.php?page= $1&id=$2
RewriteRule ^([A-Za-z0-9]+) /([0-9\-_]+)/?$ index.php?page= $1&pagenum= $2
RewriteRule ^admin/([A-Za-z 0-9\-_]+)/?$ admin/index.php ?page=$1 [L]



Edited at 11:04:48 pm on 11/21/06


    Viewed: 4,817 Times | Reply to This | To top
  This user is offline  misterhaan
  Subject: "re: Mod rewrite folders" Posted: @ 4:44 pm on Nov 22 2006    

Member #: 5
Rank: User - (213)
Since: 02/11/05
Posts: 148
From: chair

www.mydomain.co m/admin/ matches your first rule and rewrites as www.mydomain.co m/index.php?pag e=admin.

you could avoid that by inserting this rule before your first rule:

RewriteRule ^admin/?$ admin/index.php




please note that the above post is likely made up in its entirety.

    Viewed: 4,806 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank