Yii Framework Forum: Issue with .htaccess and pretty URL - Yii Framework Forum

Jump to content

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

Issue with .htaccess and pretty URL Rate Topic: -----

#1 User is offline   Arsh Qazi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 02-July 16

Posted 11 May 2017 - 07:51 AM

Hi I have enabled pretty URL and hidden frontend/web on my site. Locally its working fine but now I have uploaded it to godaddy hosting and its not working, can anyone plz help me.
My main .htaccess code is

Options +FollowSymlinks

<IfModule mod_rewrite.c>
RewriteEngine On

# deal with admin first
#RewriteCond %{REQUEST_URI} ^/(admin)
#RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
#RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L]

#RewriteCond %{REQUEST_URI} !^/backend/web/(assets|css)/
#RewriteCond %{REQUEST_URI} ^/(admin)
#RewriteRule ^.*$ backend/web/index.php [L]

RewriteCond %{REQUEST_URI} ^/backend/web/uploads/
RewriteRule ^backend/web/uploads/(.*)$ backend/web/uploads/$1 [L]

RewriteCond %{REQUEST_URI} ^/(assets|css|images|js|fonts)
RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L]
RewriteRule ^css/(.*)$ frontend/web/css/$1 [L]
RewriteRule ^images/(.*)$ frontend/web/images/$1 [L]
RewriteRule ^js/(.*)$ frontend/web/js/$1 [L]
RewriteRule ^fonts/(.*)$ frontend/web/fonts/$1 [L]

RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|images|js|fonts)/
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ frontend/web/$1 [L,QSA]


and in frontend/web .htaccss code is

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]

#2 User is offline   Patrick Jones 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 496
  • Joined: 14-July 12
  • Location:Berlin

Posted 11 May 2017 - 09:32 AM


its not working

What exactly is the problem?
Freelance developer for hire - send me a message!

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