regex


How to redirect to other host using mod_rewrite in Apache


I need to create Rewrite Rule for mod_rewrite in Apache but it's really hard for me to understand this whole syntax.
I have links such as:
http://www.example.com/0001/images/image1.gif
and I need them to redirect it to completely other server like:
http://127.127.127.127/0001/images/image1.gif
Is this achievable?
On example.com enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)example\.com$ [NC]
RewriteRule ^ http://127.127.127.127%{REQUEST_URI} [R=301,L]

Related Links

Recommendation - Resource/book/pocketbook on regex in SED [closed]
Perl: composing regex thru interpolation when subexpr has capture
RegExp regular expression find & replace whole words only
Given a certain regex pattern, re-arrange and manipulate the contents of a cell
Regular expression“\\|” in strsplit
Parsing sectioned file with augeas
I need search a pattern in a header line of my file and concatenates the next line with Perl
Regular Expression statement to replace text inside two literals
RegEx pattern with not followed by
How to pull words based on positioning from a text element using Regex?
Remove C/C++, Multiline comments from a array in which file is read
Regexp match time expression (mmmm:ss)
How do I create a regex in Emacs to capture text between double square brackets?
How to set a RegExp to have a real matching judgement?
Editing a line of a configuration file from shell
Perl replace the top-level numbers only from a tree

Categories

HOME
validation
printing
demandware
opencl
apt-get
configuration
parse.com
runtime-error
libreoffice
normalization
stripe-payments
intel-xdk
encog
oracle-adf
payment-processing
restsharp
google-analytics-api
akka.net
apache-spark-sql
struts2-jquery
drag
copy-paste
avplayer
uwsgi
chart.js2
jscrollpane
lighttpd
ellipse
calabash-android
apex
scale
android-dialogfragment
lexikjwtauthbundle
contains
spring-restdocs
slime
jpos
cayley
opencms
django-autocomplete-light
csom
grouping
fat-free-framework
ucwa
meanjs
flatbuffers
codewarrior
sql-server-2014-express
rdf4j
stl
python-responses
magento2.0.2
gosublime
api-doc
jetty-9
packaging
angular-xeditable
worldpay
consistency
easy-digital-downloads
sweet.js
maven-jetty-plugin
rating-system
simplesamlphp
multistore
sharpziplib
recurrence
complement
maven-versions-plugin
jce
facebook-canvas
jeditorpane
ipmi
vs-2015-preview
configuration-profile
gwt-material-design
xendesktop
ckcontainer
kernighan-and-ritchie
pypyodbc
cover
bash-completion
xlform
dual-table
laravel-forge
materialdrawer
coldfusion-10
ironmq
nominatim
pyenchant
double-quotes
protected
avalonedit
ppl
size-t
odoo
puppet-enterprise
spiceworks
eventmachine
email-spam
cellular-automata
nawk
android-lru-cache
rte
sugar.js
nsmanagedobjectmodel
geometry-surface
guice-servlet
datadesign
icon-fonts
word-2010
memento
wescheme
jcycle
android-actionbar-compat
nextpeer
android-actionmode
adaboost
molehill
objcopy
magento-1.5
katta
f2c
combinators
staging
codi
hunchentoot
symstore
indextank
utility
msn-messenger
greensoftware

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App