简体   繁体   English

使用htacess重写url。

[英]rewrite url using htacess.

In this point i have this structure. 在这一点上,我有这种结构。 /quote-submit-php/ what i'd like to do is to rename the last '-' into '.' /quote-submit-php/我想做的是将最后一个'-'重命名为'。 so it's going to be like this quote-submit.php basically a single character. 因此基本上就像一个quote-submit.php一样。 Thanks 谢谢

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: 通过httpd.conf启用mod_rewrite和.htaccess,然后将此代码放在DOCUMENT_ROOT目录下的.htaccess

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM