assist with htaccess file's rewrite/redirect rules
$30-250 AUD
Cancelado
Publicado hace más de 11 años
$30-250 AUD
Pagado a la entrega
Hello,
Below is a htaccess mod_rewrite issue explained, that I haven't been able to resolve.
I think there is a 5 minute fix, I hope, but am unsure, so please ask questions should the issue be unclear.
I have a website with a lot of sub-domains and I would like a rule(s) for my 'htaccess file' so that All of the following related links for each sub-domain redirects to the sub-domains' respective Index file.
In other words, all of the following should redirect to: [login to view URL]
1. [login to view URL]
2. [login to view URL]
3. [login to view URL]
4. [login to view URL]
Just like all of the following links on another sub-domain should redirect to: [login to view URL]
1. [login to view URL]
2. [login to view URL]
3. [login to view URL]
4. [login to view URL]
Here is a copy of my htaccess file, which is where I am 90% sure the problem lies:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[login to view URL] [NC]
RewriteRule ^(.*)$ [login to view URL]$1 [R=301,L]
ErrorDocument 404 /
The sub-domains' Index file contains the following PHP code, as I store and manage the redirect-to links in a database:
$domain = $_SERVER['SERVER_NAME'];
require_once '[login to view URL]';
$domain = mysql_real_escape_string($domain);
$sql = " SELECT redirect FROM redirects WHERE domain='$domain' ";
$result = mysql_query( $sql ) or die(mysql_error());
$row = mysql_fetch_row($result);
if( $redirect = $row[0] )
{
echo '<meta http-equiv="REFRESH" content="0;URL=http://'.$redirect.'">';
} else {
echo '<meta http-equiv="REFRESH" content="0;URL=[login to view URL]">';
}
Payment will be made upfront into escrow and released upon the implementation of a working solution.
Any questions, please ask before bidding. Thank you :-)