2013-05-04 79 views
0

我没有试图隐藏我的网址。我只需要对我的客户很好看。我试图掩盖的网址是:mysite.com/group/2。这将是很好,如果这是mysite.com/client。所以,每当我的客户打他的网址mysite.com/client后面的代码将从这个URL mysite.com/group/2其中group是一个模块(文件夹/来源)和2是一个主要的ID。我试过使用重写mod/Apache(.htaccess),但我没有成功。我怎样才能做到这一点?任何其他方式?由于如何屏蔽网址

这里是的.htaccess

<IfModule mod_rewrite.c> 
Options +FollowSymLinks 
RewriteEngine On 

# My Rewrite Rule 
RewriteRule ^client$ group/2 

# Get rid of index.php 
RewriteCond %{REQUEST_URI} /index\.php 
RewriteRule (.*) index.php?rewrite=2 [L,QSA] 

# Rewrite all directory-looking urls 
RewriteCond %{REQUEST_URI} /$ 
RewriteRule (.*) index.php?rewrite=1 [L,QSA] 

# Try to route missing files 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} public\/ [OR] 
RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$ 
RewriteRule . - [L] 

# If the file doesn't exist, rewrite to index 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA] 

</IfModule> 

# sends requests /index.php/path/to/module/ to "index.php" 
# AcceptPathInfo On 

# @todo This may not be effective in some cases 
FileETag Size 

<IfModule mod_deflate.c> 
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css     application/x-javascript application/javascript 
</IfModule> 
+0

请添加您的mod_rewrite尝试,以便我们可以告诉您它出了什么问题。 – Repox 2013-05-04 16:25:36

+0

Repox,我刚刚添加了我的.htaccess内容 – 2013-05-04 16:37:11

回答

0

,而不是定位在mysite.com/group/2文件尝试把你的文件在这个目录mysite.com/client在该目录中编写代码在处理你的代码的index.php文件中。这是我在我的网站上为我的博客所做的

+0

我想过移动目录,但这将是一个很大的工作。在我开始重新排列任何东西之前,我需要尝试去掩盖它。 TKS – 2013-05-04 16:44:59