www.webdeveloper.com
Results 1 to 3 of 3

Thread: Simple apache URL redirect in htaccess

  1. #1
    Join Date
    Oct 2004
    Posts
    65

    Simple apache URL redirect in htaccess

    Would somebody kind and more skillful than me format the following, because I'm struggling!:


    I would like this URL (which pops up occasionally within a Wordpress template I'm using):

    Code:
    http://www.mydomain.com/tag/search-term/
    to deliver the following page:

    Code:
    http://www.mydomain.com/?s=search-term&submit=Search
    It would solve a big problem for me. What line do I have to drop into my .htaccess file?

    Simon
    Simon Duncan
    BusyView

  2. #2
    Join Date
    Jul 2013
    Posts
    31
    Its better to use a routing engine rather than making your own htaccess rules as things get complicated. Example of a routing engine : ToroPHP(google it).

    Anyways, getting back to your point, this will be the contents of your .htaccess :
    Code:
    RewriteEngine On
    
    RewriteRule ^tag/(.*) /?s=$1&submit=Search
    I haven't tested it but it should work.

  3. #3
    Join Date
    Oct 2004
    Posts
    65

    Thank you.

    Thank you! Works (at least on one domain!)

    I think I was trying to over complicate it. Appreciate it. Routing engine - didn't know they existed. Will check it out. Thanks again.

    Simon
    Simon Duncan
    BusyView

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles