I am using the Phurl URL shortener.
Has a nice UI for entering new shortened urls. Works great.
But I now want to use the same domain to host my wordpress site. So htaccess points everything to redirect ".php" with the "alias" as a param:
RewriteRule ^([a-zA-Z0-9_-]+)$ redirect.php?alias=$1
So if I have http://example.com/tt directing to http://example.com/article-about-time-travel then "tt" will get passed to redirect.php and there will be an entry in the database for that will get turned into a 301 to the new url.
But if it's not in the database,
something like example.com/about and this is a page within my wordpress site, I want that to get passed on to wordpress.
But I don't know how to do that. I don't think it's possible to put this logic in htaccess since there can be new shortened urls and new wordpress pages and other rewrites added.
My problem is : I don't fully understand how rewrites work within wordpress so I can't figure out how to just pass the url on so that it can be rewritten by wordpress into something useful.
I tried using the header() function with no success (mostly got infinite redirects).
Any ideas???
Thanks to all.
EDIT: Here is my .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions MaxRedirects=2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([a-zA-Z0-9_-\w#]+)$ redirect.php?alias=$1
</IfModule>