1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Suggestion for .HTACCESS Issue

Discussion in 'HTML & Website Design' started by RSSeosolution, Nov 8, 2017.

  1. #1
    Hi All,

    I am not expert in htaccess but i use htaccess for one of my website after read online.
    First i use 404 page setup by htaccess
    Second i change all .php extenstion to .html and both are working fine. Code are as below

    Options +FollowSymLinks
    RewriteEngine on
    ErrorDocument 404 /bulk-email-lists.php
    RewriteCond %{THE_REQUEST} (.*)\.html
    RewriteRule ^(.*)\.html $1.php [L]

    Now i want to rewrite my page like domain.com/blog.php?id=new-page to domain.com/blog/new-page or with .php or .html extension.

    I add below code to above htaccess code and after this htaccess is not working. So please suggest us that how to use both codes in htaccess. All codes are as below

    Options +FollowSymLinks
    RewriteEngine on
    ErrorDocument 404 /404page.php
    RewriteCond %{THE_REQUEST} (.*)\.html
    RewriteRule ^(.*)\.html $1.php [L]
    RewriteBase /
    RewriteRule blog/(.*)/ blog.php?id=$1
    RewriteRule blog/(.*) blog.php?id=$1

    Please guide me with your experience. It would help me lots in learn additionally about htaccess.

    Hope for quick response.

    Thanks
    Suraj Anjaana
     
    RSSeosolution, Nov 8, 2017 IP
  2. RSSeosolution

    RSSeosolution Banned

    Messages:
    144
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    140
    #2
    Now i got it just comment a line and its working fine for domain.com/blog.php?id=few-words to domain.com/blog/few-words

    Options +FollowSymLinks
    RewriteEngine on
    ErrorDocument 404 /bulk-email-lists.php
    RewriteCond %{THE_REQUEST} (.*)\.html
    RewriteRule ^(.*)\.html $1.php [L]
    #RewriteBase /
    RewriteRule blog/(.*)/ blog.php?id=$1
    RewriteRule blog/(.*) blog.php?id=$1

    Now i want to make it domain.com/blog/few-words.html but its not working when i add few things as below. Getting not found error.
    RewriteRule blog/(.*).html$ blog.php?id=$1
    or
    RewriteRule blog/(.*)\.html blog.php?id=$1

    Please help.

    Thanks
    Suraj Anjaana
     
    RSSeosolution, Nov 8, 2017 IP