PHP Classes

htaccess Url rewritiing

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  htaccess Url rewritiing  
Subject:htaccess Url rewritiing
Summary:rewrite code in htaccess file now i am write the rewrite cod is
Messages:2
Author:ramesh
Date:2015-10-07 06:58:19
Update:2015-10-07 18:11:55
 

  1. htaccess Url rewritiing   Reply   Report abuse  
Picture of ramesh ramesh - 2015-10-07 18:11:55
I'm use the following code:

RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php
RewriteRule ^index\.html$ index.php [T=application/x-httpd-php,L]
RewriteRule ^contactus\.html$ contactus.php

RewriteRule ^pages/([0-9]+)/?$ page.php?PID=$1 [L,QSA]

This code is working fine but I have go to page.php?PID=1 show the page in http://localhost/ecom/pages/1 after I have click the home page means it's not redirected properly.

It's going to this link http://localhost/ecom/pages/index.html

How can remove 'pages' inside the URL?

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.