homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
remove/hide param from url, friendly url
danielpopa



 
Msg#: 4546715 posted 10:17 am on Feb 19, 2013 (gmt 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.

 

lucy24

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



 
Msg#: 4546715 posted 1:20 pm on Feb 19, 2013 (gmt 0)

Uhmm... And what was the question?

danielpopa



 
Msg#: 4546715 posted 1:12 pm on Feb 25, 2013 (gmt 0)

First line: I want to access domain.com/api/(.*) instead of domain.com/public/api/(.*) .. I need htaccess code to achieve this.

danielpopa



 
Msg#: 4546715 posted 1:14 pm on Feb 25, 2013 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved