从URL删除问号与htaccess的问号、URL、htaccess

由网友(把心熬成铁)分享简介:我有问题,从我的网址删除问号。I'm having problem removing the question marks from my url.现在的URL看起来像这样:www.mydomain.com/development/p/?user=me Now the URL looks like this: w...

我有问题,从我的网址删除问号。

I'm having problem removing the question marks from my url.

现在的URL看起来像这样:www.mydomain.com/development/p/?user=me

Now the URL looks like this: www.mydomain.com/development/p/?user=me

不过,我希望它是这样的:

But I want it to be like this:

现在的URL看起来像这样:www.mydomain.com/development/p/me

Now the URL looks like this: www.mydomain.com/development/p/me

我有这个htaccess文件:

I have this htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} YOURSTRING=(.*)
RewriteRule ^(.*)$ /development/p/$1? [R=301,L]
 </IfModule>

有什么建议?

推荐答案

*只有当您启用了mod_rewrite在httpd.conf工作* 建立在根目录下的.htaccess文件,并把这个在它:

*will only work if you enable mod_rewrite in httpd.conf* create a .htaccess file in the root directory and put this in it:

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

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php%{REQUEST_URI} [L]
阅读全文

相关推荐

最新文章