Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

278.Advanced search and replace -- How to make specified change for .htaccess file?

User: editor -- 2008-10-09          << 277  279 >>
Hits: 3640
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to make specified change for .htaccess file?
Input Sample:
redirect 301 /index/index.htm http://www.test.com 
redirect 301 /index/anotherpage.htm http://www.test.com/anotherpage 
... 
Output Sample:
RewriteRule ^(/index/index.htm)$ http://www.test.com [L,R=301] 
RewriteRule ^(/index/anotherpage.htm)$ http://www.test.com/anotherpage [L,R=301] 
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. click ctrl-o open your source .htaccess file 
 
2. click ctrl-h open "Replace" dialog 
1)set "Replace Unit" to "Chars" 
2)set "Replace Scope" to "Line" 
3)enter following in search for pattern: 
 
4)enter following in replace with pattern: 
 
 
3. click "Replace" button, done! save file by yourself. 
Download Script:  scripts/278.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to move the specified line to the end in multiple files? (64%)
How to batch extract specified lines from a text file? (64%)
How to shuffle all elements in a specified range in text file? (63%)
How to extract all lines with specified date range from text file? (62%)
How to remove some specified characters from multiple filenames? (61%)
How to extract all specified links from a html file? (61%)
How to make search and replace only in specified lines in text file? (60%)
How to search and replace words in specified column in csv file? (59%)

Check Demo of Advanced search and replace
Keywords:
writer  access  write  acc  dir  replace scope  scope  rule  specified  chars  htaccess search replace  htaccess search and replace  search and replace open source  change 2  search replace  search file  search 2  replace with file