Jump to content

Himanshoo

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Himanshoo

  1. i re write my code which works fine when writing url manually not from anchor tag Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^detail/([0-9]+)$ hoteldetail?hid=$1 [QSA,L] when i type manually it displays data fine like www.abc.com/detail/4 but when i come from anchor tag from main page it display url like www.abc.com/hoteldetail?hid=2 url not changed but data displays perfect.
  2. i am trying to implement seo friendly url to my website. for page where no parameter passed, the url becomes fine i.e., without php extension but where i am sending variable parameter, it does not change. Please check below 2 type of code i try to implement. First code in htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ makeurl.php?url=$1 [QSA,L] makeurl.php code: <?php //echo "<pre>"; //print_r($_SERVER); $hid = $_GET['hid']; $request = $_SERVER['REQUEST_URI']; //echo "<br>"; $router = str_replace('/wavehotels', '', $request); if($router == '/'){ include('index.php'); }elseif($router == '/hotels'){ include('hotels.php'); }elseif($router == 'hotel-detail' || preg_match("/hotel-detail\/[0-9]/i", $router)){ include('hotel-detail.php'); }elseif($router == '/destinations'){ include('destinations.php'); }elseif($router == '/about-us'){ include('about-us.php'); }elseif($router == '/blogs'){ include('blogs.php'); }elseif($router == '/contact-us'){ include('contact-us.php'); }else{ include('404.php'); } ?> i m getting result for nornal pages: www.abc.com/about.php is result in www.abc.com/about but the issue is in where parameter passed like www.abc.com/product.php?id=2 no change in this url, i want the result like www.abc.com/product/2 any input will be appreciated. Thanks Himanshoo
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.