Welcome to WebmasterWorld Guest from 54.160.177.33

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

remove/hide param from url, friendly url

     
10:17 am on Feb 19, 2013 (gmt 0)

New User

joined:Feb 19, 2013
posts:3
votes: 0


I want to access domain.com/api/(.*) instead of domain.com/public/api/(.*)

Directory structure:
domain.com
__folder1
__folder2
__public
____api
______.htaccess2
____afolder1
____afolder2
____index.html
__folder3
__file1
__file2
__.htaccess1


.htaccess1

RewriteEngine on
SetEnv APPLICATION_ENV production

RewriteRule ^$ /public/ [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/public/
RewriteCond %{REQUEST_URI} !^/api/
RewriteRule ^(.*)$ /public/$1 [L]

.htaccess2

RewriteEngine on
SetEnv APPLICATION_ENV production

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]

I tried different combinations and I came to this simplest one. I tried Alias, put the API folder on root directory, etc.

To mention that the index.html from public folder is loaded first at domain.com, public folder is document root.
1:20 pm on Feb 19, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12704
votes: 244


Uhmm... And what was the question?
1:12 pm on Feb 25, 2013 (gmt 0)

New User

joined:Feb 19, 2013
posts:3
votes: 0


First line: I want to access domain.com/api/(.*) instead of domain.com/public/api/(.*) .. I need htaccess code to achieve this.
1:14 pm on Feb 25, 2013 (gmt 0)

New User

joined:Feb 19, 2013
posts: 3
votes: 0


Basically, mapping a folder outside of DocumentRoot, as it is in root folder.