Yii Framework Forum: Pretty Urls And Htaccess - Yii Framework Forum

Jump to content

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

Pretty Urls And Htaccess time to sleep probably Rate Topic: -----

#1 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,703
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 12 February 2014 - 06:29 PM

I spent an hour trying to figure out what's wrong with my new installation.
Every seo-friendly URL (/site/page) gave me 404. I knew that mod_rewrite is on and .htaccess is correct (copied that from another vhost).

Here's the mistake:

DocumentRoot /some/path/example.com/htdocs
<Directory /some/path/exampl.com/htdocs>
    Options All
    AllowOverride All
</Directory>


Webroot is right, but AllowOverride is off because of stupid typo, so .htaccess does nothing.

Oh screw that, I need to sleep <_<
God is real unless declared as integer
2

#2 User is offline   seb 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 240
  • Joined: 29-June 09

Posted 13 February 2014 - 06:05 AM

I had the same issue few days ago with site setup on EC2 with Ubuntu server.
The problem was that there is Apache 2.4 and my in my local setup it is Apache 2.2.

And recent Apache versions (from 2.3.9) have "AllowOverride None" by default and versions before had "AllowOverride All" (see allowoverride).
0

#3 User is offline   Totto Roncone 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 12-September 13
  • Location:Il piacere - Europe

Posted 12 June 2015 - 12:48 AM

View PostORey, on 12 February 2014 - 06:29 PM, said:

I spent an hour trying to figure out what's wrong with my new installation.
Every seo-friendly URL (/site/page) gave me 404. I knew that mod_rewrite is on and .htaccess is correct (copied that from another vhost).

Here's the mistake:

DocumentRoot /some/path/example.com/htdocs
<Directory /some/path/exampl.com/htdocs>
    Options All
    AllowOverride All
</Directory>


Webroot is right, but AllowOverride is off because of stupid typo, so .htaccess does nothing.

Oh screw that, I need to sleep Posted Image


In addition to following the guide Using search engine and user friendly URLs, step by step, don't forget the advice of ORey, that I solved on this way..

Most propably by your localhost apache configuration you need change the available sites in your host:
/etc/apache2/sites-available

In my case, just I have one web page in my localhost and for that one I used:

   
	<Directory "/var/www/yii/myAppWeb/protected">
    	Options [b]All[/b]
		AllowOverride [b]All[/b]
		[b]Require all granted[/b]
	</Directory>


Important: don't forget restarting your apache server.
Thanks!
...Totto...
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