2013-07-23 123 views
0

即時通訊嘗試在我的web項目中隱藏URL的擴展文件。例如,我希望下一個URL:「local.pilarme.com.ar/owner/contacto.php」顯示「local.pilarme.com.ar/owner/contacto」。
我把我的根文件夾(local.pilarme.com.ar)與此內容的.htaccess文件:隱藏的php擴展的網址

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^([^/]+)/$ $1.php 

但是,當我嘗試 「local.pilarme.com.ar/owner/contacto」出現錯誤404。 我有活躍的mod_rewrite在我的Apache 2安裝:

[email protected]:/home/ramiro# apache2ctl -M 
Loaded Modules: 
core_module (static) 
log_config_module (static) 
logio_module (static) 
...................... 
**rewrite_module (shared)** 
setenvif_module (shared) 
status_module (shared) 
Syntax OK 

在啓用站點文件我啓用該選項的AllowOverride:

<Directory /media/Datos/www/PilarMedicinaEstetica > 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Order allow,deny 
     allow from all 
</Directory> 

是第一次做。有任何想法嗎 ?。

回答

0

已解決。在一些服務器需要指定:選項-Multiviews不顯示404錯誤^^。 Htaccess終於:

Options -Multiviews 

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php