how to convert in url " _" to "-" useing htaccess

This question already has an answer here:

  • In htaccess, I'd like to replace underscores with hyphens and then redirect the user the new url 2 answers

I have a URL that looks like:

url.com/rom_date/ct_8/first_0

How would I go about converting that URL to

url.com/rom-date/ct-8/first-0

How do I go about making friendly URLs in PHP?

-------------Problems Reply------------

With htaccess you can change your first link to the second like this :

#put me in the global htaccess file
RewriteEngine on
RewriteRule ^([^_/]+)_([^_/]+)/([^_/]+)_([^_/]+)/([^_/]+)_([^_/]+)/?$ /$1-$2/$3-$4/$5-$6 [L,NC]

Category:php Views:4 Time:2018-06-07
Tags: php .htaccess

Related post

  • how to convert this url to video view http://www.cbsnews.com/video/watch/?id=7273159n 2013-03-24

    how to convert this url to video view http://www.cbsnews.com/video/watch/?id=7273159n I need to convert it to vidoe format to download on choiceportal --------------Solutions------------- Hello Kerry E. Maas, The Video you are viewing is a flash cont

  • how to convert word attachment to PDF using Word for Mac 2004? 2014-07-30

    Hi! How to convert word attachment to PDF using Word for Mac 2004? Thanks! --------------Solutions------------- Open the attachment in Word 2004 In the main menu bar, select File > Print Click on the PDF button at the bottom left Choose Save as PD

  • How to convert query list into CSV using django 2010-01-04

    How to convert query list into CSV using django? --------------Solutions------------- Here's one simple way: from django.http import HttpResponse import csv response = HttpResponse (content_type='text/csv') writer = csv.writer(response) # now you can

  • how to convert word document to pdf using vb.net? 2010-01-24

    Possible Duplicate: How do I convert Word files to PDF programmatically? how to convert word document to pdf using vb.net using a free component like pdfsharp or itextsharp... --------------Solutions------------- I suggest you read the documentation

  • How to convert XML to something else using xslt stylesheet? 2010-01-29

    How to convert XML to something else using xslt stylesheet? In C++ C# PHP or ActionScript? For example I have this html2wiki xslt stylesheet I want to send to my programm my XML (in this case HTML file ) and get back a file (in this case Wiki mark up

  • how to convert html page to excel using html code 2010-06-22

    how to convert html page to excel using html code --------------Solutions------------- You can't. You would need to use a server-side language. HTML is not a programming language, it's a markup language (hence the name). Therefore, it will not be abl

  • How to convert a String to JsonObject using gson library 2011-02-26

    Please advice how to convert a String to JsonObject using gson library. What I unsuccesfully do: String string = "abcde"; Gson gson = new Gson(); JsonObject json = new JsonObject(); json = gson.toJson(string); // Can't convert String to JsonObject --

  • how to convert .msg file to PDF using perl 2011-07-13

    How to convert .msg file to PDf using perl (or) any option to conver .msg file to html using perl Thanks in Advance. --------------Solutions------------- Converting to PDF is the easy part. Reading the .msg file will be the hard part, as it's a propr

  • How to convert HTML output into Image using PHP 2011-07-14

    Possible Duplicate: How to convert HTML data into Image using PHP <? //put your html code here $html_code = ' <html> <body> Image Out Put </body> </html>'; $img = imagecreate("300", "600"); imagecolorallocate($img,0,0,0); $

  • how to convert WAV format to FLAC using libFLAC++ 2012-04-17

    how to convert WAV format to FLAC using libFLAC++ (encode.h and decode.h) --------------Solutions------------- There's a nice C++ example in the libflac source tarball. It's also possible to browse it online (single cpp file). Decode Encode

  • How to convert doc to pdf file using itext 2012-04-27

    i need how to convert doc to pdf file using itext. i am using the following code it is not working. i am using itext 2.1.7.jar. The following error is coming Exception in thread "main" ExceptionConverter: java.io.IOException: The document has no page

  • How to load asp.net webpages faster using .htaccess 2011-03-21

    How to load asp.net webpages faster using .htaccess.. what was the coding for .htaccess so that the webpages loads faster ..i have hosted my site on ...ixwebhosting. .. --------------Solutions------------- The .htaccess file is used by web servers li

  • How to convert image to byte array using javascript only to store image on sql server? 2012-02-13

    I am struggling converting image to byte array using client side script. I have to convert image to byte array, and pass this array to web service , so that the web services can save the image in sql server. Any one please help me. --------------Solu

  • How to convert form data to object using MooTools 2010-01-29

    I would like to convert an entire form of data to a javascript object. <form id='myform'> <input type='text' name='field1' value='foo'> <input type='text' name='field2' value='bar'> </form> would convert to a javascript object

  • how to convert html page to image using java or php 2010-05-06

    I want to know how to convert html file to image. How do I do this? --------------Solutions------------- You can checkout the source code for the popular BrowserShots service, http://browsershots.org/ If you're running Windows, and have the GD librar

  • How to convert datatable to json string using json.net? 2010-06-05

    How to convert datatable to json using json.net? Any suggestion... I ve downloaded the necessary binaries... Which class should i use to get the conversion of my datatable to json? Thus far used this method to get json string by passing my datatable.

  • How to convert a PDF from HTML using C#? 2010-08-15

    Can anyone tell me how to convert a PDF document from an HTML code using C#? I'm using itextsharp 5.0.2 dll. I have come across this forum. I didnt find any solution so far. And some of them mentioned iTextSharp.HtmlParser but i cannot find such kind

  • How to Convert a .MPG to .FLV using PHP on Azure Platform 2010-09-05

    Hey Friends How we can Convert a MPG to FLV using PHP on Azure Platform?can you gave me a good tutorial links? --------------Solutions------------- Step 1 - install ffmpeg, see this thread http://groups.google.com/group/ffmpeg-php-windows/browse_thre

  • How to convert this VBScript code to use with JScript in TestComplete? 2011-01-17

    How to convert the following VBScript code to use with JScript in TestComplete? We are trying to invoke the application/.exe using Windows Script Host functions instead of the predefined functions in TestComplete. strExe = "C:\whatever\myprogram.exe

  • How to convert a Shape to MovieClip using ActionScript 3.0 only 2011-03-08

    import flash.display.Shape; import flash.display.Graphics; stage.addEventListener(Event.ENTER_FRAME, startAnim); function startAnim(e:Event):void { var shape1:Shape = new Shape(); shape1.graphics.beginFill(0x333333,1); shape1.graphics.drawRect(40,50,

  • How to convert one type to another using reflection? 2011-03-20

    I have a two types that are very similar (i.e. the member names are very similar). Is there an elegant way to copy one type to another, without having to copy each individual member by hand? Update Here is some sample source code: main() { FromCsvFil

  • How to convert Excel XLS to CSV using PHP 2011-10-14

    I am new to php. Can anyone guide me how to convert XLS to CSV using PHP? I have excel spread sheet which contains a list of documents, I want to convert this with CSV format using PHP. pls guide me to solve this. --------------Solutions-------------

  • How to convert Codeigniter into .net dll using phalanger? 2012-02-23

    I've been trying to get codeigniter working on .Net platform with the use of Phalanger. This is just an test exercise, and I want to actually convert Codeigniter into dll, so that I can remove source code from wwwroot/inetpub folder and just put comp

  • Advice on how to convert factors to integers by using the as.numeric 2012-02-28

    I have the following code anna.table<-data.frame (anna1,anna2) write.table<-(anna.table, file="anna.file.txt",sep='\t', quote=FALSE) my table in the end contains numbers such as the following chr start end score chr2 41237927 41238801 151 chr1

  • How to convert wav file to mp4 using ffmpeg in android? 2012-03-30

    I am having a wav file.How to convert wav file into mp4 file container format with AAC as audio stream using FFmpeg in android.I know how compile and port ffmpeg for android.Can anybody give me right direction thanks, --------------Solutions---------

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.120 (s). 11 q(s)