2014-10-08 51 views
0

我想在共享主機中創建動態子域,但我無法訪問httpd.conf文件和任何服務器文件。我已經在我的cPanel中創建了一個通配符子域。如何在共享主機中創建動態子域

我只是想讓這個網址:www.example.com/books.php?tag=Love-Books & CURRENT_PAGE = 2(.httaccess操作後的網址是www.example.com/Love-書籍/ 2)像子域一樣工作,如www.Love-Books.example.com和所有其他網址正常工作。我有這樣的代碼在我的.htaccess文件:

RewriteEngine On 

RewriteRule \.(css|jpe?g|gif|png|js)$ - [L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^authors/([^/]*)$ authors.php?current_page=$1 [NC,L] 

RewriteRule ^([^/]*)/([^/]*)$ books.php?tag=$1&current_page=$2 [NC,L] 

RewriteRule ^Books-single/([^/]*)/([^/]*)$ book-single.php?tag=$1&id=$2 [NC,L] 

RewriteRule ^Books-by/([^/]*)/([^/]*)$ book-by.php?auth=$1&current_page=$2 [NC,L] 

RewriteRule ^authors-by/([^/]*)/([^/]*)$ authors-by.php?author-by=$1&current_page=$2 [NC,L] 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php 

回答

0

本指南可以幫助你理解這個過程:使用.htaccess文件,並與PHPCreate Subdomains on the Fly

+0

正如我所說我沒有訪問任何服務器文件我將如何執行您的鏈接的第2步...包括通配符在虛擬主機 – Anup 2014-10-08 06:45:28