2013-05-08 82 views
1

現在我現在有這個腳本的工作htaccess的代碼重寫

.htaccess文件:

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /profile.php?username=$1 

,這不正是我想要的東西。它顯示:

example.com/userid 

,而不是

example.com/profile.php?username=userid 

但我現在想實現這樣的一個方面。我嘗試有:中

example.com/c/1234 

代替

example.com/c/postpage.php?link=1234 

目錄似乎與我的.htaccess代碼搞亂,我甚至不能接近它的工作。

歡迎任何建議。

回答

1

試圖改變自己的的.htaccess文件的源與此代碼:

RewriteEngine on 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([^/]+)$ /profile.php?username=$1 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^c/([^/]+)$ /c/postpage.php?link=$1 
+1

謝謝你,做到了。 – user2360599 2013-05-08 23:14:07