2015-10-16 88 views
0

我需要重写这个URL模式的Apache的.htaccess国防部重写

http://www.example.com/a/b/c/d.php?param=hi 

http://www.example.com/a/b/d.php?type=c&param=hi 

有可能与在.htaccess mod_rewrite的?

非常感谢您的帮助!

[更多信息]

网站的基本URL是http://www.example.com/a/b/,并且我有两个类型的客户,私处&卖家。我询问客户是否有可能拨打这个网址http://www.example.com/a/b/private/index.php,并用htaccess在内部重写它,以保留其他GET参数http://www.example.com/a/b/index.php?cust=private

+0

这仅仅是简单地从一个URL重定向到b网址。也许更多关于你期望发生的信息会有所帮助。它应该重定向还是不等等? –

+0

好的,对不起,我提供了一些细节。网站的基本网址是http://www.example.com/a/b/,我有两种类型的客户,私人和卖家。我询问客户是否有可能将此网址称为http://www.example.com/a/b/private/index.php,并使用htaccess将其内部重写为http://www.example.com/a /b/index.php?cust=private保存其他GET参数。 –

回答

0

那么如果URL总是相同的,你可以直接写一对一。

RewriteEngine On 
RewriteRule ^a/b/private/index\.php$ /a/b/index.php?cust=private [QSA,L] 
+0

非常感谢!!!! –

0

好的基础上,巴拿马杰克的回答这是重写所有网页标准的规则,

RewriteEngine On  
RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)$ $2.php?cust=$1 [QSA]