May
1
htaccess Permanently redirect file or directory
May 1, 2008 |
If you would like to redirect your files or directories, but are worried about search engines or favorites that are linked to your old files or directories, add the following example to the .htaccess file. Just replace the filename and extension with your own.
Redirect permanent /filename.html http://www.example.com/filename.php
Redirect permanent /shell/install-ubuntu/ http://www.blog.highub.com/linux/install-ubuntu/
The first line above will redirect a link from filename.html to the new filename.php. The second line redirect directory. I believe it is required to have the entire http: protocol for the new file.
Similar Posts
- Use htaccess to Deny Access Directory Listing
- htaccess Explicitly Define Default Index File
- htaccess Remove the www From Domain URL
- Block IPs Using htaccess
- Force Files Like PDF Download using htaccess
- Use htaccess with Site Maintenance Page
- Block people from Certain URL Using htaccess
- htaccess Conditional Loop Redirect
- Remove File Extension Using htaccess
- Create Custom Error Pages Using htaccess PHP
- Google Text Translation Using htaccess
- Use htaccess to Fake Different File Extension
- htaccess Require the www For Domain URL
- Use htaccess for 404 Redirect
- Useful mod_rewrite Resources
- Deny Access to inc Files Using htaccess
- Apache htaccess Prevent Users from Uploading and Executing Files
- htaccess gzip for Faster Loading and Bandwidth Saving
- htaccess Deny Diractory Access During a Specific Time
- Use htaccess to Deny Access to hidden Files
- Set Local Timezone Using htaccess
- htaccess Limit the Number of Concurrent Visitors to your Website
Comments
2 Comments so far



































thanks for providing this useful tutorial! :)
[...] Posted December 8, 2008 Filed under: Uncategorized | htaccess Permanently redirect file or directory | Highub - Web Development Blog Similar [...]