2016-06-17 3 views
2

でURLでparametresを取得非表示にする方法は示していますPhalcon - 私はちょうどhtaccessファイルを使用してルーティングすることなく、ID部分を隠し、どうすればよい</p> <pre><code>localhost/case?id=name </code></pre> <p>のようなURLを持っているの.htaccess

localhost/case/name 

psフレームワークphalcon

htaccessファイルは持っている:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L] 
</IfModule> 
+2

あなたがいないたく使用ルーティングを行うのはなぜ? – Juri

+0

@Juri .htaccessを使用しようとしていますが、動作しない場合はルータ – th3King

答えて

0

これを試してみてください:

#if our requested file isn't a dir, and isn't a file, and isn't a symbolic link 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-l 
#then skip our next rule below 
RewriteRule .* - [S=1] 
#since we got here, the file exists, so don't rewrite it, skip the next two rules 
RewriteRule .* - [S=2] 
#these two rules are bound to our condition i.e. if the link is broken 
RewriteRule ^case/([^/]*)$ index.php?_url=/case&id=$1 [QSA,L] 
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L] 
#end of our two rules which would be skipped if our condition was false 
+0

ありがとうございます – th3King

0

はこの試してみる:

RewriteEngine On 
RewriteRule ^case/([^/]*)$ /case?id=$1 [L] 
+0

thxを使用しますが、動作しません。( – th3King

関連する問題

 関連する問題