2

My subdomain for e.g http://web.example.com/ and main domain http://example.com/ My site hosted on gandi.net server, When i have created sub domain it's automatically created subdomain folder web.example.com

Folder structure is:

Main domain: /lamp0/web/vhosts/example.com/htdocs/ and source code of wp

Sub domain: /lamp0/web/vhosts/web.example.com/htdocs/ and source code of ci

My main domain site in WordPress and subdomain site in codeigniter framework. When i run the sub domain it's call the WordPress index.php file

Wordpress .htaccess is:

# BEGIN WordPress
<IfModule mod_rewrite.c>

RewriteEngine on

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

And codeigniter .htaccess is:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>

Anyone can suggest me where is the issue ? why calling the main domain file when i try to subdomain.

  • Why don't you try the gandi.net help pages [here](https://wiki.gandi.net/en/dns/zone/subdomain?s[]=subdomain)? – ShutUpMagda Dec 01 '16 at 11:41
  • I already get help with support team, but they say coding issue.@ShutUpMagda – Kishan Chauhan Dec 01 '16 at 11:45
  • Are you controlling the web server? Can you get access to the server's config files? – ShutUpMagda Dec 01 '16 at 11:47
  • Yes both site file i can controlling via sFTP @ShutUpMagda – Kishan Chauhan Dec 01 '16 at 11:59
  • So create a subdomain by hand. It is not enough to changing directory names like you did. You need to tell to your webserver that a different configuration to this directory exists. Then, you'll need to set your DNS rules to match with your webserver settings. **OBS:** `.htaccess` files control the directory rules, not the 'server configuration'. What is your server (Apache, nigx, etc)? – ShutUpMagda Dec 01 '16 at 12:10
  • thanks for your information @ShutUpMagda . Server linux. – Kishan Chauhan Dec 01 '16 at 12:16
  • Linux, ok, but what's your webserver [Apache](https://httpd.apache.org/), [nginx](https://www.nginx.com/), etc? – ShutUpMagda Dec 01 '16 at 12:25
  • If it's calling the Wordpress index.php then it looks like a DNS configuration or a server configuration problem. I doubt code (or .htaccess) have anything to do with this. To make sure, create a test.html file in your subdomain only with a simple frase or word. Then try your browser `web.example.com/test.html`, if you get a Wordpress 404 error then it is not a coding error. – Marc Compte Dec 01 '16 at 12:31
  • Man, gandi.net has a control panel where you can do such configuration settings. – ShutUpMagda Dec 01 '16 at 12:34
  • webserver appache @ShutUpMagda and sub domain creating on simple hosting where gandi.net provide – Kishan Chauhan Dec 01 '16 at 12:46
  • @MarcCompte yes when i try to test.html or test.php it's work!!! , but when i run only web.example.com it's direct calling wordpress index file and when try rename of wp file index1.php that time run the sub domain perfect, and then wp site not work. – Kishan Chauhan Dec 01 '16 at 12:51
  • @ShutUpMagda does not provide cPanel, file management using sftp only – Kishan Chauhan Dec 01 '16 at 12:59
  • Then [this](http://askubuntu.com/a/463623), or [this](https://httpd.apache.org/docs/2.4/vhosts/examples.html), or [this](http://stackoverflow.com/a/18342313/6054930) or [this](http://stackoverflow.com/a/13838733/6054930) should help you. – ShutUpMagda Dec 01 '16 at 13:06

0 Answers0