Jump to content

rishibala143

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by rishibala143

  1. Hi I am using this .htaccess code for my project. This is working correctly. I am very new in to this. I got some reference from websites and developed this .htaccess code. I have seen in some sites, they use only very minimal code for seo friendly url. But mine looks very long. Is there any way to reduce this code. Kindly help me by giving me some examples. I surfed in web, but i didn't get what i want. Kindly help !!! #set link auto on Options +FollowSymLinks -MultiViews DirectoryIndex index.php DirectoryIndex index.html Options -Indexes RewriteEngine on RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.yourdomain.com/ [R=301,L] RewriteCond %{HTTP_HOST} !^(.*)\.yourdomain\.com$ [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ RewriteRule (.*)$ http://www.yourdomain.com/$1/ [R=301,L] RewriteRule ^about-us/$ about-us.php [L] RewriteRule ^customer-services/$ customer-services.php [L] RewriteRule ^contact-us/$ contact-us.php [L] RewriteRule ^terms-conditions/$ terms-conditions.php [L] RewriteRule ^privacy-policy/$ privacy-policy.php [L] RewriteRule ^brands/$ brands.php [L] RewriteRule ^products/$ products.php [L] RewriteRule ^shopping-cart/$ cart.php [L] RewriteRule ^new-products/$ products.php [L] RewriteRule ^popular-products/$ popular-products.php [L] RewriteRule ^best-deals/$ best-deals.php [L] RewriteRule ^product-search/$ product-search.php [L] RewriteRule ^product-advanced-search/$ asearch.php [L] RewriteRule ^keyword-search/$ keyword-search.php [L] RewriteRule ^advanced-search/$ advancedsearch.php [L] RewriteRule ^register/$ register.php [L] RewriteRule ^login/$ login.php [L] RewriteRule ^reseller/$ reseller.php [L] RewriteRule ^logout/$ logout.php [L] RewriteRule ^forgot-password/$ forgot-password.php [L] RewriteRule ^my-account/$ myaccount.php [L] RewriteRule ^my-profile/$ myprofile.php [L] RewriteRule ^change-password/$ changepassword.php [L] RewriteRule ^wishlist/$ wishlist.php [L] RewriteRule ^pro-order/$ pro-order.php [L] RewriteRule ^col-order/$ col-order.php [L] RewriteRule ^can-order/$ can-order.php [L] RewriteRule ^dis-order/$ dis-order.php [L] RewriteRule ^imageviewer/([^/]*)\/$ imageviewer.php?pid=$1 [L] RewriteRule ^products/([^/]*)/([^/]*)\/$ main-category.php?ml_id=$1&ml_name=$2 [L] RewriteRule ^products/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ main-category.php?ml_id=$1&ml_name=$2&sortby=$3&ordby=$4&page=$5 [L] RewriteRule ^products/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ sub-category.php?ml_id=$1&ml_name=$2&sl_id=$3&sl_name=$4 [L] RewriteRule ^products/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ sub-category.php?ml_id=$1&ml_name=$2&sl_id=$3&sl_name=$4&sortby=$5&ordby=$6&page=$7 [L] RewriteRule ^products/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ sub-sub-category.php?ml_id=$1&ml_name=$2&sl_id=$3&sl_name=$4&ssl_id=$5&ssl_name=$6 [L] RewriteRule ^products/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ sub-sub-category.php?ml_id=$1&ml_name=$2&sl_id=$3&sl_name=$4&ssl_id=$5&ssl_name=$6&sortby=$7&ordby=$8&page=$9 [L] RewriteRule ^products/([^/]*)/([^/]*)/([^/]*)\/$ products.php?sortby=$1&ordby=$2&page=$3 [L] RewriteRule ^new-products/([^/]*)/([^/]*)/([^/]*)\/$ products.php?sortby=$1&ordby=$2&page=$3 [L] RewriteRule ^popular-products/([^/]*)/([^/]*)/([^/]*)\/$ popular-products.php?sortby=$1&ordby=$2&page=$3 [L] RewriteRule ^best-deals/([^/]*)/([^/]*)/([^/]*)\/$ best-deals.php?sortby=$1&ordby=$2&page=$3 [L] RewriteRule ^product-search/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ product-search.php?sea_mlid=$1&sea_slid=$2&sea_sslid=$3&sea_brandid=$4&sea_min_price=$5&sea_max_price=$6 [L] RewriteRule ^product-search/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ product-search.php?sea_mlid=$1&sea_slid=$2&sea_sslid=$3&sea_brandid=$4&sea_min_price=$5&sea_max_price=$6&sortby=$7&ordby=$8&page=$9 [L] RewriteRule ^keyword-search/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ keyword-search.php?txtsearch=$1&sortby=$2&ordby=$3&page=$4 [L] RewriteRule ^wishlist/([^/]*)/([^/]*)\/$ wishlist.php?action=$1&page=$2 [L] #RewriteRule ^product-advanced-search/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\/$ asearch.php?smlid=$1&sslid=$2&sgenid=$3&sbrandid=$4&sstyid=$5&sheelid=$6&smatid=$7&searchprice=$8&sortby=$9&ordby=$10&page=$11 [L] RewriteRule ^product-details/([^/]*)/([^/]*)\/$ main-product.php?prod_id=$1&prod_name=$2 [L] RewriteRule ^login/([^/]*)\/$ login.php?msg=$1 [L] RewriteRule ^reseller/([^/]*)\/$ reseller.php?res_msg=$1 [L] RewriteRule ^brands/([^/]*)/([^/]*)\/$ brands.php?baction=$1&page=$2 [L] RewriteRule ^processing/([^/]*)/([^/]*)\/$ pro-order.php?porder=$1&page=$2 [L] RewriteRule ^collected/([^/]*)/([^/]*)\/$ col-order.php?corder=$1&page=$2 [L] RewriteRule ^dispatched/([^/]*)/([^/]*)\/$ dis-order.php?dorder=$1&page=$2 [L] RewriteRule ^cancelled/([^/]*)/([^/]*)\/$ can-order.php?canorder=$1&page=$2 [L] RewriteRule ^order-details/([^/]*)\/$ orderview.php?ord_id=$1 [L] #set link start http://www.yourdomain.com Regards P.Balakrishnan.
  2. Yes you are correct. The Problem is solved. Thanks for your help :) Regards P.Balakrishnan
  3. Hi I am developing a e-commerce website. The user logs in and buy a product when he checkout the page will redirect to the payment gateway. After the payment is completed it will return back to my website. This is ok. But when it is returning back the session maintained in my website get lost. This happen only for the first time. If the user again logged in and checkout the process works good and the session is maintaining. Why does the session lost for first time. I used session_start() in all the pages.. I cannot find the solutions. Kindly help.. Regards P.Balakrishnan
  4. Hi I am new to mod_rewrite I need two things to do in htacess 1. I want all my php pages to display as html Example : index.php to index.html aboutus.php to aboutus.html I given like this Options +FollowSymLinks RewriteEngine on RewriteRule ^([^/]*)\.html$ index.php?action=$1 RewriteRule ^([^/]*)\.html$ aboutus.php?action=$1 This works good. But for this a query string is passes. I don’t want to give any query string. If I click index.php it should redirect to index.html. I don’t want to write separate for aboutus.php. within a single code it should redirect all php to html pages 2. The most wanted thing I want to search a thing using city name in my project For example If I click the cityname eg.chennai The following url will be like this : www.domainname.com/search.php?city=chennai But I want like this http://chennai.domainname.com if I click Mumbai it should be http://mumbai.domainname.com How to do this ? I want like this site http://www.clickindia.com/ http://www.indialist.com There if we click the city name it will redirect the url as cityname.domainname.com Please help
×
×
  • 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.