0
我使用的Apache 2.4.9重寫URL APACHE 2.4.9 htaccess的
我想htaccess的重寫的URL
https://localhost/balance.php/editbalance
當我上面的URL輸入應低於
顯示像https://localhost/editerapi/editbalance
我都試過,但它不工作
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^editerapi/?$ balance.php [NC,L]
RewriteCond %{REQUEST_URI} ^/editerapi [NC]
RewriteRule ^.*/([^/]+)/? balance.php/$1 [L] #POST
我重寫引擎是
隱藏PHP擴展的下面代碼工作
RewriteEngine On # Turn on the rewriting engine
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule^%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [QSA,L]
請看https://meta.stackexchange.com/questions/22186/how-do -i-格式我的代碼塊。 – chris85
'RewriteRule^editerapi((?:/.*)?)$ balance.php $ 1 [NC,L]' – Deadooshka