Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 23rd, 2012, 05:16 AM
rishibala143 rishibala143 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2009
Posts: 5 rishibala143 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 22 sec
Reputation Power: 0
Help need for .htaccess code

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 !!!


Code:
#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

[[ please use code tags when posting .htaccess files --requinix ]]


Regards
P.Balakrishnan.

Last edited by requinix : March 23rd, 2012 at 05:48 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Help need [refactoring] .htaccess code

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap