2013-05-04 77 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