Skip to main content
deleted 4 characters in body
Source Link
Champion
  • 51
  • 1
  • 7

I have my blog running at a server with ip 10.10.10.10(not real).

There is only one virtual host for this blog on the server.

Here is the apache configuration:

VirtualHost star:80
ServerName blog.example.com
ServerAlias blog.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/
RewriteEngine on
RewriteCond %{10.10.10.10HTTP_HOST} ^[^.]+.example.com$
RewriteRule ^(.+) %{10.10.10.10HTTP_HOST}$1 [C]
RewriteRule ^([^.]+).example.com/(.*) /var/www/$1
DirectoryIndex index.php

Directory /var/www/ AllowOverride All
Order Deny,Allow
Allow from all
/Directory
/VirtualHost

My DNS blog.example.com is pointing to this ip address 10.10.10.10 .

When I load first time blog.example.com it loads correct with no problems. But whenever i click a link it shows url like http://10.10.10.10/login.php etc.

I am a newbie. Please help me set up this.
Is there any problem with the rewrite rule ?

I have my blog running at a server with ip 10.10.10.10(not real).

There is only one virtual host for this blog on the server.

Here is the apache configuration:

VirtualHost star:80
ServerName blog.example.com
ServerAlias blog.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/
RewriteEngine on
RewriteCond %{10.10.10.10} ^[^.]+.example.com$
RewriteRule ^(.+) %{10.10.10.10}$1 [C]
RewriteRule ^([^.]+).example.com/(.*) /var/www/$1
DirectoryIndex index.php

Directory /var/www/ AllowOverride All
Order Deny,Allow
Allow from all
/Directory
/VirtualHost

My DNS blog.example.com is pointing to this ip address 10.10.10.10 .

When I load first time blog.example.com it loads correct with no problems. But whenever i click a link it shows url like http://10.10.10.10/login.php etc.

I am a newbie. Please help me set up this.
Is there any problem with the rewrite rule ?

I have my blog running at a server with ip 10.10.10.10(not real).

There is only one virtual host for this blog on the server.

Here is the apache configuration:

VirtualHost star:80
ServerName blog.example.com
ServerAlias blog.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+.example.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+).example.com/(.*) /var/www/$1
DirectoryIndex index.php

Directory /var/www/ AllowOverride All
Order Deny,Allow
Allow from all
/Directory
/VirtualHost

My DNS blog.example.com is pointing to this ip address 10.10.10.10 .

When I load first time blog.example.com it loads correct with no problems. But whenever i click a link it shows url like http://10.10.10.10/login.php etc.

I am a newbie. Please help me set up this.
Is there any problem with the rewrite rule ?

deleted 3 characters in body; added 3 characters in body; added 44 characters in body; added 2 characters in body
Source Link
Champion
  • 51
  • 1
  • 7

I have my blog running at a server with ip 10.10.10.10(not real).

There is only one virtual host for this blog on the server.

Here is the apache configuration:

<VirtualHost *VirtualHost star:80>80
ServerName blog.example.com

ServerAlias
ServerAlias blog.example.com

ServerAdmin abhay@example
ServerAdmin ab@example.com

DocumentRoot
DocumentRoot /var/www/

RewriteEngine
RewriteEngine on

RewriteCond
RewriteCond %{10.10.10.10} ^[^.]+.example.com$

RewriteRule
RewriteRule ^(.+) %{10.10.10.10}$1 [C]

RewriteRule
RewriteRule ^([^.]+).example.com/(.*) /var/www/$1

DirectoryIndex
DirectoryIndex index.php

<DirectoryDirectory /var/www/>

AllowOverride AllowOverride All 
Order Deny,Allow 
Allow from all 
/Directory
/VirtualHost

  

My DNS blog.example.com is pointing to this ip address 10.10.10.10 .

When I load first time blog.example.com it loads correct with no problems. But whenever i click a link it shows url like http://10.10.10.10/login.php etc.

IsI am a newbie. Please help me set up this.
Is there any problem with the rewrite rule ?

I have my blog running at a server with ip 10.10.10.10(not real).

There is only one virtual host for this blog on the server.

Here is the apache configuration:

<VirtualHost *:80> ServerName blog.example.com

ServerAlias blog.example.com

ServerAdmin abhay@example.com

DocumentRoot /var/www/

RewriteEngine on

RewriteCond %{10.10.10.10} ^[^.]+.example.com$

RewriteRule ^(.+) %{10.10.10.10}$1 [C]

RewriteRule ^([^.]+).example.com/(.*) /var/www/$1

DirectoryIndex index.php

<Directory /var/www/>

AllowOverride All Order Deny,Allow Allow from all

 

My DNS blog.example.com is pointing to this ip address 10.10.10.10 .

When I load first time blog.example.com it loads correct with no problems. But whenever i click a link it shows url like http://10.10.10.10/login.php etc.

Is there any problem with the rewrite rule ?

I have my blog running at a server with ip 10.10.10.10(not real).

There is only one virtual host for this blog on the server.

Here is the apache configuration:

VirtualHost star:80
ServerName blog.example.com
ServerAlias blog.example.com
ServerAdmin ab@example.com
DocumentRoot /var/www/
RewriteEngine on
RewriteCond %{10.10.10.10} ^[^.]+.example.com$
RewriteRule ^(.+) %{10.10.10.10}$1 [C]
RewriteRule ^([^.]+).example.com/(.*) /var/www/$1
DirectoryIndex index.php

Directory /var/www/ AllowOverride All 
Order Deny,Allow 
Allow from all 
/Directory
/VirtualHost

 

My DNS blog.example.com is pointing to this ip address 10.10.10.10 .

When I load first time blog.example.com it loads correct with no problems. But whenever i click a link it shows url like http://10.10.10.10/login.php etc.

I am a newbie. Please help me set up this.
Is there any problem with the rewrite rule ?

Source Link
Champion
  • 51
  • 1
  • 7

apache2 configuration for blog.example.com not working

I have my blog running at a server with ip 10.10.10.10(not real).

There is only one virtual host for this blog on the server.

Here is the apache configuration:

<VirtualHost *:80> ServerName blog.example.com

ServerAlias blog.example.com

ServerAdmin [email protected]

DocumentRoot /var/www/

RewriteEngine on

RewriteCond %{10.10.10.10} ^[^.]+.example.com$

RewriteRule ^(.+) %{10.10.10.10}$1 [C]

RewriteRule ^([^.]+).example.com/(.*) /var/www/$1

DirectoryIndex index.php

<Directory /var/www/>

AllowOverride All Order Deny,Allow Allow from all

My DNS blog.example.com is pointing to this ip address 10.10.10.10 .

When I load first time blog.example.com it loads correct with no problems. But whenever i click a link it shows url like http://10.10.10.10/login.php etc.

Is there any problem with the rewrite rule ?