Full URL Redirection of Theme URL
-
I think this is the right place for this question. I could not be so clear in the title but I will give you more details.
Here is the thing. I developed a small framework and I would like to use its’ awesome URL Routing System in WordPress’ Theme I’m currently developing.
But this URL Routing System is based upon clean URL’s like:
/foo/bar/option/value
But the WordPress’ Admin URLs, specifically in the Themes’ Page, as far as I know about WordPress is pre-established as admin.php?page=some-value
Where some-value is what we defined in the fourth parameter of add_menu_page() function.
I tried some trick in the .htaccess file to redirect the requests:
RewriteCond %{REQUEST_URI} wp-admin/sometext.*? RewriteRule !\.(js|ico|gif|jpg|png|css)$ wp-content/themes/ThemeName/admin/index.php [NC]And it was a success, or at least I thought it was. I was able to access pages like:
And by analyzing the REQUEST URI received I got /foo/bar, and from this point my Framework is able to handle the Requests.
But, as I said, it was not correctly, because I was REDIRECTING the request, and by doing this, even partially working, I could not have my code side by side the WordPress’ Admin Menu (or header, footer…)
In fact, I couldn’t even access constants defined, because the request did not came through WordPress’ logical structure, and no require call were made.
Is this kind of hack possible in any way?
The topic ‘Full URL Redirection of Theme URL’ is closed to new replies.