我想在共享主机中创建动态子域,但我无法访问httpd.conf文件和任何服务器文件。我已经在我的cpanel中创建了一个通配符子域。
我只想制作此网址: www.example.com/books.php?tag=Love-Books¤t_page=2 (在.httaccess操作之后,网址为 www。 example.com/Love-books/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¤t_page=$2 [NC,L]
RewriteRule ^Books-single/([^/]*)/([^/]*)$ book-single.php?tag=$1&id=$2 [NC,L]
RewriteRule ^Books-by/([^/]*)/([^/]*)$ book-by.php?auth=$1¤t_page=$2 [NC,L]
RewriteRule ^authors-by/([^/]*)/([^/]*)$ authors-by.php?author-by=$1¤t_page=$2 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php