hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Rewrite Engine not working since migration
Reply

Forum Jump

Rewrite Engine not working since migration

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 03-03-2006, 12:00 PM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137

Rewrite Engine not working since migration


Hello,
Thanks for looking into this matter.

Since our Webhosting provider asked us all to migrate all of our IPs, I have done so as well.

However, when my website migrated, and I anticipated all the DNS changes, the rewrite engine wasn't working anymore

It is still not working since more than a week, meaning half the website is down since then..

I really don't know where it comes from.

The rewrite engine was meant to to the following

redirect
http://www.domain.com/index.php?u=something
into
http://something.domain.com

I'm sure it's well written because it was the same before migration, and it was working till then

When i go to http://something.domain.com , the domain is resolved, but leads to the plesk default page that you get into when a domain is not configured properly or DNS are not applied

Any help would be greatly apreciated
Thanks!



Sponsored Links
  #2  
Old 03-03-2006, 01:09 PM
arkin arkin is offline
Web Hosting Guru
 
Join Date: Feb 2003
Location: L.A. C.A.
Posts: 335
use this instead, no rewrite engine needed.

PHP Code:
<?php // This code should be put in index.php, arkin/Mar0306. //
$domain "domain.com";
if (isset(
$_GET['u'])&&!empty($_GET['u'])) {
preg_match("/([A-Za-z0-9]*)/i",$_GET['u'],$redirect);
if (!empty(
$redirect[0])) die(header("Location: http://".$redirect[0].".".$domain));
}
This should work, sorry i took so long to reply.

Change $domain to your domain.

__________________
WLKNS.co - A collection of my programmer thoughts

  #3  
Old 03-03-2006, 01:25 PM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
sorry!

I made a typo, i meant that the redirection which isn't working is the
http://something.domain.com
into
http://www.domain.com/index.php?u=something


all the opposite

Thanks nonetheless for your help!

Sponsored Links
  #4  
Old 03-03-2006, 01:30 PM
arkin arkin is offline
Web Hosting Guru
 
Join Date: Feb 2003
Location: L.A. C.A.
Posts: 335
Oh dear

Have you checked that the rewrite module is enabled in your apache configuration and that the DNS propogates the the IP address of your server for all the subdomains?

__________________
WLKNS.co - A collection of my programmer thoughts

  #5  
Old 03-03-2006, 02:33 PM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
DNS both on the server and those who sold me the domain have the * (wildcard) applied directing to the IP

The rewrite engine I suppose is working since I haven't deactivated it after having migrated IPs (it was working before)

  #6  
Old 03-03-2006, 06:44 PM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
please share your thoughts so I can apply them and let you know

  #7  
Old 03-03-2006, 09:06 PM
maxymizer maxymizer is offline
Web Hosting Evangelist
 
Join Date: Apr 2005
Posts: 521
Can you post your rewrite rules and doublecheck that you have wildcard DNS entry for your domain?

  #8  
Old 03-03-2006, 10:19 PM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
hi

here is what my DNS looks like
Code:
domain.com.    NS    ns.domain.com.    
*.domain.com.    A    208.65.60.88    
mail.domain.com.    A    208.65.60.88    
domain.com.    A    208.65.60.88    
ns.domain.com.    A    208.65.60.88    
webmail.domain.com.    A    208.65.60.88    
ftp.domain.com.    CNAME    domain.com.    
www.domain.com.    CNAME    domain.com.    
domain.com.    MX (10)    mail.domain.com.    
208.65.60.88 / 24    PTR    domain.com.
And this is what my rewriting engine looks like


Code:
RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.domain\.com?<>/([^/]*) [NC]
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
RewriteRule   ^(.*)$ - [E=BLOGUSER:%1]

RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^page([0-9]+)/?$ /index.php?u=%1&page=$1 [L]

RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^profile/?$ /profile.php?u=%1 [L]

RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive_(.*)_(.*)_.html$ /archive.php?u=%1&y=$1&m=$2 [L]

RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive_(.+).html /archive.php?u=%1 [L]

RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive.html /archive.php?u=%1 [L]

RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^([0-9]+)/?$ /entry.php?u=%1&e_id=$1 [L]

RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^$ /index.php?u=%1 [L]
thanks again, any help is apreciated !

  #9  
Old 03-04-2006, 11:05 AM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
any help please?
is the code correct?
DNS is set correctly?

  #10  
Old 03-05-2006, 04:23 PM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
any rewritting engine gurus out there?

  #11  
Old 03-05-2006, 04:58 PM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
could we try to put some basic rewritting stuff to test if it actually works? that way we'd know the problem is coming fom DNS

  #12  
Old 03-05-2006, 07:02 PM
RadiantDesigns RadiantDesigns is offline
New Member
 
Join Date: Mar 2006
Location: VA
Posts: 4
yea testing it would def be the best idea..

  #13  
Old 03-06-2006, 03:27 AM
riquelme riquelme is offline
WHT Addict
 
Join Date: Mar 2006
Posts: 137
your site's animation is wonderful RadiantDesigns, grats for it


Do you happen to know a basic rewritting rule to test ? I have no knowledge in rewritting engine... I wasn't who made that one (although he worked before changing IPs)

Reply

Related posts from TheWhir.com
Title Type Date Posted
Google Compute Engine Expands OS Support, Lowers Prices in General Availability Web Hosting News 2013-12-03 13:08:34
RiverMeadow Software Raises $12M in Funding to Support Cloud Migration SaaS Web Hosting News 2013-09-04 09:58:26
Rackspace Offers Customers Free Cloud Migration Service Web Hosting News 2013-08-13 16:08:49
AppScale Systems Launches Google App Engine-Based Public Cloud Service Web Hosting News 2013-06-28 11:34:44
IBM Acquires Data and Storage Migration Software Provider Butterfly Software Web Hosting News 2012-09-24 16:24:21


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?