LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Apache Migration/Compatibility (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=24)
-   -   Importing an Apache Vhost to Existing Litespeed Installation (http://www.litespeedtech.com/support/forum/showthread.php?t=5473)

docarzt 11-09-2011 04:56 PM

Importing an Apache Vhost to Existing Litespeed Installation
 
Hello,

I have Litespeed for cPanel and my situation is as follows:

I partner with another company and they had a vhost setup (tvovermind.zap2it.com) that simply sent all traffic to my ip/dns. Now we've moved to our own domain and the engineer at the company sent me the following vhost info to add to my "apache config" so that my server would redirect requests coming through the vhost to the new root domain:

<VirtualHost *:80>
ServerName tvovermind.zap2it.com
RewriteEngine On
RewriteRule ^(.*)$ http://www.tvovermind.com$1 [R=301,L]
</VirtualHost>

Obviously since I'm not running Apache, this does me no good and my server tech is MIA. How do I port this directive to the existing litespeed install?

Thanks in advance.

webizen 11-09-2011 05:16 PM

you can put the rewrite rules in .htaccess under vhost docroot. make sure vhost AllowOverride is set to FileInfo at least to make .htaccess effective.

docarzt 11-09-2011 05:26 PM

Quote:

Originally Posted by webizen (Post 30641)
you can put the rewrite rules in .htaccess under vhost docroot. make sure vhost AllowOverride is set to FileInfo at least to make .htaccess effective.


I tried and it won't work because I need to trick litespeed into believing tvovermind.zap2it.com is on my server and redirect those requests to tvovermind.com. Hence the reason to add the vhost to apache, or in this case litespeed, config....

webizen 11-09-2011 05:37 PM

make sure DNS of tvovermind.zap2it.com point to the server served by litespeed. you can test with below if DNS is not ready.
Quote:

curl -I -H "host: tvovermind.zap2it.com" http://IP_address_of_litespeed_server
should see a 301 redirect.

docarzt 11-09-2011 05:45 PM

Quote:

Originally Posted by webizen (Post 30643)
make sure DNS of tvovermind.zap2it.com point to the server served by litespeed. you can test with below if DNS is not ready.


should see a 301 redirect.

Yes this is working for root domain only. for some reason links like:

tvovermind.zap2it.com/greys-anatomy/greys-anatomy-sneak-peeks-season-8-episode-9-dark-was-the-night/103776

are not redirecting. the server guy at tribune sent the vhost entry as the fix. Maybe there is an issue with the htaccess...

# 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

Options -Indexes

RewriteEngine On
RewriteRule (.*) http://www.tvovermind.com/$1 [R=301,L]

that is what we have in there.

webizen 11-09-2011 05:49 PM

you should remove the rules for WP. you are doing redirect for everything. no need to keep them.


All times are GMT -7. The time now is 04:59 AM.