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.
  2. Better Analytics for WordPress Get It Free

How to rewrite urls in .htsccess?

Discussion in 'Apache' started by falconlink, Feb 17, 2012.

  1. #1
    Hi,

    I am a php programmer and have started to learn SEO tips recently. I came to face a problem with writing .htaccess codes. I have created a .htaccess page and uploaded that. But problem is while I click on about.php, it move to about.html and then get a 404 (page not found) error. Here is the code, I have written exactly-

    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)\.php$ $1.html [R=permanent]
    
    RewriteEngine on
    RewriteRule ^profile/page-([0-9]+)\.html$ profile.php?page=$1
    Code (markup):
    I have few static and dynamic urls-
    /about.php
    /services.php
    /contact.php
    /portfolio.php?page=2

    But I want to show like-
    /about.html
    /services.html
    /contact.html
    /portfolio/page-2.html

    Can anybody help me to solve the problem?
     
    falconlink, Feb 17, 2012 IP
    theauthor likes this.