url-redirection


How to redirect all pages in a subfolder to a single page


I recently changed my site's directory structure and also started using php to generate file names. All of my previous files have been renamed so that they can be easily accessed via the mysql/php. Site works fine. Problem is existing links on external sites point to the old directory/file, e.g.,
<site>/library_wheels/wheel-1-name.html
<site>/library_wheels/wheel-2-name.html
<site>/library_wheels/wheel-3-name.html
I want any request to any html file in the old library_wheels directory (which no longer exists) to go to a general index page:
<site>/library_wheels.php.
There the visitor can look up the right link.
Or should I put in nearly a thousand 301 redirects in the .htacess file?
Thanks
Mar 22: tried #Marc B's answer; doesn't work.
June 14, 2015: tisantisan's answer worked, but I had to specify the full url of the destination page:
RewriteRule ^http://www.bps.lk/library_wheels.php [R=301,L,NC]
Or else, #Marc B's answer worked, but I must have typed it in wrong!
This works for me:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^library_wheels/ library_wheels.php [R=301,L,NC]

Related Links

Redirect https://domain.com to https://www.domain.com in Godaddy
How do I use redirections and the Google search console?
OPENWRT : Redirect all wireless client's http/https traffic to the local webserver?
HAProxy redirect to subdomain
Gtmetrix Mimimize Redirect Chains
outlook calendar api redirection uri with vhost , not working
Redirect address when IP and port are mapped to domain
Masking an URL after redirect
How to redirect without change url?
.Search bar not storing history correctly on redirect from separate search page
301 redirect index.html to index.php and hide index.php from the url
Check redirect rules from .htaccess file
301 Redirect with limited access to site
How to create a custom expression to 301 redirect multiple html pages to a single page
URL Rewrite Module and Folder Redirects
handling URI redirect response in OAuth2 user agent flow

Categories

HOME
google-app-engine
embedded
eclipse
turing-machines
api
obfuscation
jwplayer
vscode-extensions
opendj
rom
regular-language
hpc
settings
spring-session
retrofit2
title
arangodb
fabric.io
octave
github-enterprise
supervisor
plink
screen-readers
job-scheduling
microsoft-dynamics-nav
digital-signature
windows-xp
named-entity-recognition
object-storage
displaytag
interpreter
stackexchange
jackson-modules
asymptotic-complexity
sinch
openmdao
corenlp-server
eviews
zend-debugger
git-squash
android-maps-extensions
openwhisk
pop3
sharding
nested-lists
installscript
playframework-2.1
openalpr
z-notation
filesystemwatcher
verifiable-c
vmware-fusion
laravel-elixir
xmldocument
apache-directory
libgphoto2
sonarlint-eclipse
chai-as-promised
netbeans6.8
insight
payara-micro
css-transforms
branch-prediction
cvxpy
android-dateutils
xdoclet
observablecollection
createprocess
jbase
character-replacement
dllimport
fiware-monitoring
oracle-spatial
video-player
fuelcms
extjs-grid
finalbuilder
dulwich
jquery-forms-plugin
nodelist
easyrtc
verold
mintty
maven-scm
code-duplication
cocoalibspotify-2.0
http-status-code-410
wimax
monotouch.dialog
sentestingkit
uimanageddocument
isa-swizzling
google-maps-mobile
drawtobitmap
strsep
cac
load-time
ie-compatibility-mode
blender-2.49
fault-tolerance
leader
great-circle

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile