0

助けが必要

私はこのようなリンクを持っています

http://www.mysite.com/obj/task/land/city/41277/landId/19/Best+Restaurant//Sville%20city

htaccessの使用

RewriteRule ^l/([0-9]+)/([0-9]+)/?$ index.php?obj=obj&task=land&city=$1&landId=$2
RewriteRule ^l/([0-9]+)/([0-9]+)$ index.php?obj=obj&task=land&city=$1&landId=$2

今私のリンクはこのようになります

 http://www.mysite.com/l/41277/19

このようなリンクが受け入れられるようにするには、htaccess に何を追加すればよいですか?

http://www.mysite.com/l/41277/19/Best+Restaurant//Sville%20city
http://www.mysite.com/l/41247/17/Best+parks/Cold%20Province/Platinum%20city
4

1 に答える 1

1

mod_rewrite と .htaccess を有効にしてからhttpd.conf、このコードをディレクトリの.htaccess下に配置します。DOCUMENT_ROOT

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

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^l/([0-9]+)/([0-9]+)/? /index.php?obj=obj&task=land&city=$1&landId=$2 [L,QSA,NC]
于 2013-06-26T11:20:24.907 に答える