Yii Framework Forum: Removing App Folder Name From Url - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Removing App Folder Name From Url Rate Topic: -----

#1 User is offline   bonez05 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 28-November 12

Posted 28 November 2012 - 04:41 PM

Okay seems like this is a pretty common problem, but I can't find a definitive solution on the forums.

My Yii is set up like this

/webroot/framework
/webroot/app
/webroot/requirements


the app folder hosts the yii application

however my url looks like : site[dot]com/app/site/index

How do I remove the 'app' portion from the URL.

I tried moving my .htaccess file to the webroot folder and it redirects but 'app' still shows up in the url

Here are the contents of /webroot/.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
 RewriteBase /
  
 # need this for AMZN ELB or get a infinite redirect loop 
 RewriteCond %{HTTP:X-Forwarded-Proto} !https
 RewriteCond %{SERVER_NAME} !^localhost$
 RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI} [L]
 
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 
RewriteRule . /app/index.php 
</IfModule>


I would be easy if I could just change my webroot to /webroot/app but I can't control that. Thanks for any help
0

#2 User is offline   Muaid 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 112
  • Joined: 25-October 10
  • Location:Saudi Arabia

Posted 29 November 2012 - 05:01 PM

you dont need .htaccess to achive this.

btw, you also dont need requirements folder in production server its only a checker.

the quick answer would be this file structure:

framework/webroot

webroot/<app folder CONTENT>




that is it ;-)


0

#3 User is offline   germanliu 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 26-September 12

Posted 13 July 2013 - 03:05 PM

Hi, where you able to resolve this? I have the same problem.

Thanks
0

#4 User is offline   Muaid 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 112
  • Joined: 25-October 10
  • Location:Saudi Arabia

Posted 16 July 2013 - 03:34 AM

if you have the same problem you can use the same method,, or let me know if you have other probelm :)

thank you.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users