Jump to content
php.lv forumi

htaccess


Lord

Recommended Posts

Sveiki!

 

Vēlos samainīt savus .php ekstenšenus pret "/" vai tos vienkārši noņemt. Pilnībā noņemt ir izdevies(t.i., caur website.com/index ieiet var), taču, verot vaļā website.com/index/ lapa meklē pēc index.php.php, kura, protams, nav. Kur varētu būt kļūda?

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*)$ $1.php

RewriteRule ^(.*)/$ $1.php

Link to comment
Share on other sites

RewriteRule ^(.*)/$ $1.php [L]

RewriteRule ^(.*)$ $1.php [L]

 

 

Ieteiktu kārtot dilstošā secībā, jo

 

(.*) ietver gan /index, gan /index/, bet

(.*)/ ietver tikai /index/

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*)/$ $1.php [L]

RewriteRule ^(.*)$ $1.php [L]

Rakstot šādi, man lapa vienkārši izmet 500. error.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*)/$ $1.php [L]

Šādā veidā man strādā website.com/index, bet uz website.com/index/ met, ka "No input file specified. ". Es kaut ko rakstu nepareizi?

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...