Hi,

I have a site which i added mod write to the url.
Some of the pages are not opening correctly. For example, the WHIWH login, should open a user & pass field in the page. You can see it is not opening it. http://www.whiwh.com/login/

Also a page like this http://www.whiwh.com/who_we_are/bill_of_rights/ does not open the actual page. it is sort of the same problem as the login page above.

This is my htaccess code:

RewriteEngine On
RewriteRule ^([0-9a-z\_]+)/$ /index.php?pname=$1 [L]
RewriteRule ^([0-9a-z\_]+)/([0-9a-z\_]+)/$ /index.php?pname=$1&spname=$2 [L]
RewriteRule ^([0-9a-z\_]+)/([0-9a-z\_]+)/([0-9a-z\_]+)/$ /index.php?pname=$1&spname=$2&sspname=$3 [L]
RewriteRule ^login/$ /staff.php?mid=8&smid=0&ssmid=0&login=1 [L]
RewriteRule ^forgot/$ /staff.php?mid=8&smid=0&ssmid=0&pass=1 [L]
RewriteRule ^account/$ /staff.php?mid=8&smid=0&ssmid=0&account=1 [L]
RewriteRule ^modpass/$ /staff.php?mid=8&smid=0&ssmid=0&modpass=1 [L]
RewriteRule ^meet/$ /staff.php?mid=8&smid=0&ssmid=0&meet=1 [L]
RewriteRule ^logout/$ /staff.php?mid=8&smid=0&ssmid=0&logout=1 [L]
RewriteRule ^newsletter/$ /newsletter.php?mid=7&smid=44&ssmid=8&news=1 [L]

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

AuthName whiwh.com
AuthUserFile /home/xxx/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/xxx/public_html/_vti_pvt/service.grp

ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php

AddHandler server-parsed .scss
AddType application/x-javascript .js
suPHP_ConfigPath /home/xxx/public_html

Here is the code where i deal with the mod write within the php page.

if (isset($_GET['pname'])) {
		$pname = str_replace('_', ' ',  $_GET['pname']);
		$pname = str_replace ('and', '&', $pname); 										
		$pname = ucwords($pname);
		if ($_GET['pname']=='calendar_of_events') {
			$mid = 4;
			$midT = 'Calendar of Events';
		} else {
				$pnameQ = mysql_query("SELECT menu_id, title FROM menu WHERE title = '".$pname."' ") or trigger_error("Query: $pnameQ\n<br />MySQL Error: " .mysql_error());
				if(mysql_affected_rows() > 0){	//if not empty, display
					$pnameR = @mysql_fetch_array ($pnameQ);
					$mid = (int) $pnameR['menu_id'];
					$midT = $pnameR['title'];
					mysql_free_result ($pnameQ); // Free up the resources.
				}
		}
} 
	 
if (isset($_GET['spname'])) {
 		$spname = str_replace('_', ' ', $_GET['spname']);
 		$spname = str_replace ( 'and', '&', $spname); 										
		$spname = ucwords($spname);
		$spnameQ = mysql_query("SELECT smenu_id, title FROM smenu WHERE title = '".$spname."' ") or trigger_error("Query: $spnameQ\n<br />MySQL Error: " .mysql_error());
		if(mysql_affected_rows() > 0){	//if not empty, display
			$spnameR = @mysql_fetch_array ($spnameQ);
			$smid = (int) $spnameR['smenu_id'];
			$smidT = $spnameR['title'];
			mysql_free_result ($spnameQ); // Free up the resources.						 			 
		}

	} 
	 

if (isset($_GET['sspname'])) { 
		$sspname = str_replace('_', ' ', $_GET['sspname']);
		$sspname = str_replace ('and', '&',$sspname); 
		$sspname = ucwords($sspname);    
		$sspnameQ = mysql_query("SELECT ssmenu_id, title FROM ssmenu WHERE title = '".$sspname."' ") or trigger_error("Query: $sspnameQ\n<br />MySQL Error: " .mysql_error());
		if(mysql_affected_rows() > 0){	//if not empty, display
			$sspnameR = @mysql_fetch_array ($sspnameQ);
			$ssmid = (int) $sspnameR['ssmenu_id'];
			$ssmidT = $sspnameR['title'];
			mysql_free_result ($sspnameQ); // Free up the resources.						 			 
		}

	}

If you look above, i had the same problem in Calendar of Events, therefore, i had to manually declare the variables $mid and midT. That is the only way it worked.
any help is welcomed.

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.