Rewrite problem

#1
OK, I'm trying to rewrite http://tdperry.com to go to http:/tntcomputersvc.com.

Here is what I have listed in my one (and only) vhost definition for the rewrite rules

Code:
RewriteCond %{HTTP_USER_AGENT}  ^NameOfBadRobot
RewriteRule ^/nospider/        -  [F]

RewriteCond %{HTTP_HOST} ^tdperry.com$ [NC]
RewriteRule ^(.*)$ http://tntcomputersvc.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

From everything I've read, it should be working - but it's not.

My error log shows this (enabled rewrite logging level 9)
Code:
2014-03-20 07:41:25.944 [INFO] [64.188.254.247:63759] [REWRITE] Cond: Match 'tntcomputersvc.com' with pattern '^tdperry.com$', result: -1
Any suggestions?
 
#2
OK... don't know if it's right or not, but the below works (lord, nginx is so much easier for me now that I've learned it! :D)
Code:
RewriteRule ^(.*)$ http://tntcomputersvc.com/$1 [R=301,L]
 
#4
Duhhh... I been up WAY to long. Figured out what the problem was. I was "assuming" that the on/off button above the log level was for logging of rewrites (that's what I get for not reading closely) but it's to turn them on/off!
 
#6
I'm glad you found that yourself. I have no idea how long it would have taken for us to figure that one out. ;)
Lately it's been the "simple" stuff that's been getting me. I just got a new E3-1230 v3 server with 6 240GB SSD drives in a RAID 10 array with ProxMox set up on it. Been busy as a beaver moving some sites off my dedicated servers over to VPS's on it (mainly because the servers are RAID 1 software) and figured I'd (for the heck of it) just use OpenLiteSpeed instead of nginx for my personal blogs.
One of those "Can't see the forest for the trees" situations.
One of the other "hard" things I had to figure out was how to serve multiple sites from one instance (http://tdperry.us and http://tkperry.com). Finally figured that out and now my wife and my blog are up running with OLS. I'm about to move my motorcycle site over to another VPS on it. Think I may run OLS on it also after I figure out how to password protect individual files and directories with it.
 
#8
Check this out: http://openlitespeed.com/threads/password-protecting-single-file-with-litespeed-contexts.119/

The important thing for password protecting a single file is making the Location and URI the same. I promise I will update the documentation in the WebAdmin for this as soon as I can. (I don't know when that will be, though. It's getting bumped now...)
When you say the same... I'm assuming you mean in location place /admin.php and URI also /admin.php?

I've got my Linux site (http://servinglinux.com) running live on it currently. Still testing the password protection stuff.
 

lsmichael

Active Member
#9
When you say the same... I'm assuming you mean in location place /admin.php and URI also /admin.php?
Actually, not exactly the same. I believe the location should have a . at the beginning. I might be wrong about that, though...
 
Top