RewriteRule to centralized index and SEO URI's

CLOSED

RewriteRule to centralized index and SEO URI's

Postby tunafish » Thu Feb 11, 2010 6:30 am

I am making a site with photo albums for agents.
Each agent dir has unique numeric album folders containing an index.php file that redirects to a centralized album.php like this:
RewriteRule ^[^/]+/[^/]+/index\.php$ albumpage/album.php (I should make the second argument numeric though)

mysite.com/
mysite.com/agent1/
mysite.com/agent1/005/
mysite.com/agent1/005/index.php
mysite.com/agent1/006/
mysite.com/agent1/006/index.php
mysite.com/agent2/
mysite.com/agent2/009/
mysite.com/agent2/009/index.php
...
mysite.com/albumpage/
mysite.com/albumpage/album.php


Now I would like to map shortcuts:
mysite/005 redirects to mysite/agent1/005
mysite/009 redirects to mysite/agent2/009

Since I will have lots of agent and album folders this needs to be dynamic.
I understand I should send URI requests to a php script, tied to a DB, which handles the 301
mysite.com/redirect.php?id=005

Another think I would love is SEO URI's:
mysite/005 redirects to mysite/agent1/005-some-nice-keywords

Is this possible? Thanks.
tunafish
 
Posts: 1
Joined: Thu Feb 11, 2010 6:23 am

Return to New Threads/Problems

Who is online

Users browsing this forum: No registered users and 6 guests

cron