Your SlideShare is downloading. ×
0
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Some of Important .htaccess Codes Everyone Should Known
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Some of Important .htaccess Codes Everyone Should Known

2,612

Published on

Some of Important .htaccess Codes Everyone Should Known

Some of Important .htaccess Codes Everyone Should Known

Published in: Technology, Design
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,612
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Some Of Important .htaccess Codes    
  • 2. Redirect Non WWW to WWW RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule ^(.*) http://www.example.com/$1 [R=301]    
  • 3. Redirect index.php to non index.php RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ http://www.example.com/$1 [R=301,L]    
  • 4. To Redirect WWW to Non WWW RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]    
  • 5. For redirect all index.php url to non index.php in  magento (Ecommerce Websites) RewriteEngine on RewriteBase / RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ http://www.example.com/$1 [R=301,L] RewriteRule ^index.php/(.*) $1 [R=301,QSA,L]    
  • 6. Changed your Pages from .html to .php RedirectMatch 301 (.*).html$ http://www.example.com$1.php    
  • 7. To Redirect One page to Another Page Redirect /old-index.html http://www.mynewwebsite.com/foldername/new-index.html    
  • 8. PHP Header Redirect <?php header ('HTTP/1.1 301 Moved Permanently'); header( "http://www.new-website.com" ); ?>    
  • 9. To Redirect One Page to Another Page Redirect /old-index.html http://www.mynewwebsite.com/foldername/new-index.html    
  • 10. To Start Inner Pages of WordPress Website # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress    

×