0

I wanted to make dynamic subdomain in my shared hosting but I don't have access to httpd.conf file and any of the server file. I have already created a wildcard subdomain in my cpanel.

I just wanted to make this url: www.example.com/books.php?tag=Love-Books&current_page=2 (after .httaccess manipulation the url is www.example.com/Love-books/2) to work like subdomain like www.Love-Books.example.com and all the other url to work normally. I have this code on my .htaccess file:

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
Anup
  • 1
  • 2

1 Answers1

0

This guide can help you understand the process: Create Subdomains on the Fly using the .htaccess file and with PHP.

Community
  • 1
  • 1
Crisoforo Gaspar
  • 3,740
  • 2
  • 21
  • 27
  • as i said i don't have access to any server files how will i perform step 2 of your link... Include the wildcard in vhost – Anup Oct 08 '14 at 06:45