Jump to content
php.lv forumi

nestrādā mod_rewrite


yeahz

Recommended Posts

Tas mod_rewrite vienmēr ir bijis ļoti niķīgs, nekad neesmu bijis draugos ar viņu. :D

 

Lieta tāda, ka viņš vienkārši nestrādā. Ir noņemts komentārs (#) no LoadModule rewrite_module modules/mod_rewrite.so. Lai arī ko tik es neierakstītu .htaccessā, vienmēr rāda 404 Not Found, pat ja ierakstu "deny from all". Ja tas kaut ko maina, tad es izmantoju virtual hosts (kurš vismaz strādā). Ceru uz atsaucību, kā tikt ar šo galā.

Link to comment
Share on other sites

Vaina ir kaut kur virtual hostos. Zem http://localhost/ htaccess strādā, bet zem kāda cita vistuālā hosta nestrādā, piemēram zem http://auto/ .

 

Konfigurācija:

 

httpd.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

httpd-vhosts.conf

<VirtualHost 127.0.0.1>
  DocumentRoot C:\AppServ\www
  ServerName localhost
</VirtualHost>



<Directory C:\web>
 Order Deny,Allow
 Allow from all
</Directory>


NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
DocumentRoot C:\web\auto
ServerName auto
</VirtualHost>

un hosts

127.0.0.1 auto

Link to comment
Share on other sites

<VirtualHost 127.0.0.1>
DocumentRoot C:\web\auto
ServerName auto
Options FollowSymLinks
AllowOverride FileInfo 
</VirtualHost>

Uzliku šādi, bet tagad visas lokālās lapas (tai skaitā arī lacalhost) ir vienkārši baltas, neatkarīgi no tā vai tur ir htaccess vai nav.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...