从URL删除问号与htaccess的 [英] Remove questionmark from URL with htaccess

查看:512
本文介绍了从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: 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]

这篇关于从URL删除问号与htaccess的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆