Some mod_rewrite issues

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
antubis
Forum Newbie
Posts: 16
Joined: Sun Apr 30, 2006 1:48 pm
Location: Pavlikeni, Bulgaria
Contact:

Some mod_rewrite issues

Post by antubis »

Hello to all.

I`m new to SEO and mod_rewrite stuff and I have some problems.
I want the following to happen

site.com/Admin -> site.com/admin.php
site.com/Admin/post -> site.com/admin.php?action=post
site.com/Admin/edit/id/3 -> site.com/admin.php?action=post&id=3

for last one I write the code below

Code: Select all

RewriteRule ^Admin/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([0-9]+)/?$ admin.php?action=$1&$2=$3 [L]
It works fine.
But for the other two whatever I write the page break

Should I write a new RewriteRule for each one or I can do this with a single one?
Why when I reach site.com/Admin/edit/id/3/ the whole .css and .images disapeared and is there anyway to fix the problem without using full paths?

I`ll be very thankful if you tell me what is the right sintax for this.
basdog22
Forum Contributor
Posts: 158
Joined: Sun Nov 30, 2003 3:03 pm
Location: Greece

Post by basdog22 »

Try this:

Code: Select all

RewriteRule ^Admin/([A-Za-z0-9]+)/([A-Za-z0-9]+)/([0-9]+)/?$ admin.php?action=$1&$2=$3 [L]
antubis
Forum Newbie
Posts: 16
Joined: Sun Apr 30, 2006 1:48 pm
Location: Pavlikeni, Bulgaria
Contact:

Post by antubis »

I don`t see the diffrent between yours and mine code .. or I`m wrong?
Post Reply