Htaccess help please

Discussion in 'PHP' started by dvrtmcc, Mar 20, 2011.

  1. #1
    Any thoughts on how this simple task can be done?
    This:
    example.com/index.html?domain=google.com

    to be this:
    example.com/google.com

    There is one solution but don't know if it is working or not. Of course using rewrite mod and all functions what one server can do.
     
    dvrtmcc, Mar 20, 2011 IP
  2. J Bin

    J Bin Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If there is a solution, why haven't you tried it ?

    RewriteEngine On
    Options +FollowSymlinks
    
    RewriteRule ^(.*)$ index.html?domain=$1
    Code (markup):
     
    J Bin, Mar 20, 2011 IP
  3. matrixmxn

    matrixmxn Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    rewrite mode is the best solution
    @J Bin
    thanks for the htacess rule
     
    matrixmxn, Mar 20, 2011 IP
  4. dvrtmcc

    dvrtmcc Well-Known Member

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    113
    #4
    Oh I have this also in htaccess:
    RewriteEngine On
    RewriteRule ^(.*)\.html $1\.php

    So it shows "Not Found" error. You see what I'm talking about?
     
    dvrtmcc, Mar 22, 2011 IP
  5. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #5
    You may need to alter your htaccess file by adding a base url, for example

    after
    RewriteEngine On
    Code (markup):
    add
    RewriteBase /
    Code (markup):
    ...and if that cures the initial problem, then simple add your solution ?
     
    MyVodaFone, Mar 22, 2011 IP