我有下面的网址,我想要美化。任何帮助表示赞赏。
这;
http://www.example.co.uk/search-menu?r_id=1&name=testname
到
http://www.abklab.co.uk/search-menu/1/testname
我在下面尝试过,但收到内部服务器错误
# external redirect from actual URL to pretty one (WEB)
RewriteCond %{THE_REQUEST} \s/+search-menu(?:\.php)?\?r_id=([^\s&]+)&name=([^\s&]+) [NC]
RewriteRule ^ /search-menu/%1/%2? [R=302,L,NE]
# internal forward from pretty URL to actual one (WEB)
RewriteRule ^search-menu/([\w-]+)/([\w-]+)/?$ search-menu.php?r_id=$1&name=%2 [L,QSA,NC]
仅供参考:以下规则会删除.php扩展站点范围;
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=302,L]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^(.+?)/?$ $1.php [L]
答案 0 :(得分:1)
在你的htaccess中试试这个:
ceilometer sample-list -m cpu_util -q metadata.user_metadata.some_name=some_value
ceilometer statistics -m cpu_util -q metadata.user_metadata.some_name=some_value -p 60 -a avg
答案 1 :(得分:0)
为您找到一些东西 - 该向导将帮助您完善您的网址 http://www.generateit.net/mod-rewrite/index.php
答案 2 :(得分:0)
将此行添加到.htaccess文件中。这将使变量和make变得美观漂亮:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)\.html$ /search-menu?r_id=$1&name=$2 [L]
请记住这是基本的,您需要将其修改为您的地址,但这只是为了让您了解您需要做什么。