regex


.htaccess URL rewriting adivce - remove text from url [closed]


how to redirect the following with .htaccess file, i tried & i figured out to write rule for redirect each url, but how to write a common rule.
need to remove the text "article" form the URL,
examples:
zzz.com/article/a/b to zzz.com/a/b
zzz.com/article/g/h to zzz.com/g/h
zzz.com/article/c/v to zzz.com/c/v
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your DOCUMENT_ROOT/.htaccess file:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?zzz\.com$ [NC]
RewriteRule ^article/(.*) /$1 [L,NC]
PS: If you want external redirection then use:
RewriteCond %{HTTP_HOST} ^(www\.)?zzz\.com$ [NC]
RewriteRule ^article/(.*) /$1 [L,NC,R]

Related Links

Regex Extract All using pig
Python RE: Find all matches of pattern b following patter a
VS 2015 Regex find and replace
Tokenizing a string with a regular expression
Regex - How to properly grab nested value
How to use sed to remove lines with pattern in square brackets
Jmter complicated regular expression solution? [duplicate]
Google analytics filter RegEXp assistance
RegEx design a pattern to extract id from url?
Regular Expressions | Delete words on multiple lines before a given word
Findstr - Return only a regex match
Converting VB function to Regex?
how to put text after a line beginning with http?
How to find a regex in re2 to search between strings?
How to combine two lists in one list? using notepad++ regex? [duplicate]
Scala - Explanation for regex statement

Categories

HOME
asp.net-mvc
wpf
dynamic-programming
vb.net
whatsapp
music
tags
react-navigation
python-3.5
applet
afp
backand
xcode8
xquery
weblogic11g
openvpn
apple-mail
wget
telnet
cobol
session-cookies
threadpool
nservicebus
smartsheet-c#-sdk-v2
apache-kafka-streams
next
web-audio
atmelstudio
formio
pydev
ormlite-servicestack
robotium
ucwa
popupwindow
background-process
seh
google-domain-api
spring-data-cassandra
apartment-gem
texture-mapping
ipod-touch
ase
kendo-chart
sql-insert
dependency-management
adal.js
jawr
hipi
netbeans-7
findall
mysql-notifier
angular2-rc5
topojson
error-correction
accounts
uiswitch
relaxng
parsoid
fab
mtp
kindlegen
pegkit
smarty2
iscroll4
ratingbar
epoll
django-postgresql
dynamic-data-display
short
serverside-javascript
hebrew
modalpopupextender
validform
declspec
modx-evolution
flash-cs4
datapump
git-gui
pixelsense
xsocket
qbwc
ribbon-control
time-limiting
noindex
jammit
facebook-authentication
regexbuddy
n900
graceful-degradation

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