.htaccess - Php mod_rewrite is not working properly -


i've php page following link structure:

http://localhost/wisper/businesspage.php?profile=creativeartbd 

so i'm trying convert link following style:

http://localhost/wisper/creativeartbd 

.htaccess configuration

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename} !-l rewriterule ^businesspage/(.*?)/(.*)$/wisper/businesspage.php?profile=$1 [qsa,l] 

but not working propery. think code wrong, can plz tell me ?

thank you.

update:

my php page code bellow:

echo "<h4><a href='businesspage.php?profile=$uname_d'>$uname_d</a></h4>"; 

now it's show link:

http://localhost/wisper/businesspage.php?profile=creativeartbd 

so want show link this:

http://localhost/wisper/creativeartbd 

update 2:

while($res = mysql_fetch_array($sql)) {  $mid = (int) $res['mid']; $uname_d = inputvalid($res['uname']);    $profile_pic_d = inputvalid($res['profile_picture']);    $mid = base64_encode($mid); echo "<div class='members'>"; //echo "<h4><a href='businesspage.php?profile=$uname_d'>$uname_d</a></h4>"; echo "<a href='/wisper/$uname_d'>$uname_d</a>"; ?> <img src="<?php echo "$upload_directory/$profile_pic_d"; ?>" width="99"  height="100"/> <?php echo "</div>"; } 

you doing wrong try this

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename} !-l rewritebase / rewriterule ^wisperpage/(.*?)$ wisper/businesspage.php?profile=$1 [qsa,l] 

you need change first uri segment because rewriting wisper/creativeartbd wisper/businesspage.php?profile=$1 creates infinite loop


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -