How to get ' www.domain.com/my-value' with htaccess?

Discussion in 'PHP' started by webmaster365, May 31, 2010.

  1. #1
    How to get ' www.domain.com/my-value' with htaccess?
    I want to create few pages but my URL should like this below

    mydomain.com/apple

    Suppose I am having a page on apple so the URL look like above.

    Thanks in advance.
     
    webmaster365, May 31, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    Whats the original url index.php?something=apple ?

    If so something like this should do

    
    Options +FollowSymLinks
    
    RewriteEngine on
    
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteCond %{REQUEST_FILENAME} !-f
    
    RewriteRule (.[^/]*) /index.php?something=$1 [NC,L]
    
    PHP:
     
    MyVodaFone, May 31, 2010 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    for that you will need to create a php get bassed processor.. and use the above .htaccess
     
    Bohra, May 31, 2010 IP
  4. webria

    webria Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Please read through search engines on rewrite rule and htaccess. And you may try the below code.
    RewriteRule ^(.*)$ http://yourdomain.com/$1
     
    webria, Jun 1, 2010 IP