My old url is
and new url is
http://www.tuitionok.com/patna/home-tuition/computer-home-tuition-in-patna/0
I am trying to forward the old url to new
I am using this .htaccess code
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)$ result.php?city=$1&type=$2&text=$3&sr=$4 [L]
I am successfully get the parameter values and displaying the result. But the actual problem is that both old and new url is working. I think my htaccess file should be modified to redirect url forcely to the new url.
Try this:
Options +FollowSymLinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ result.php?city=$1&type=$2&text=$3&sr=$4 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/$ result.php?city=$1&type=$2&text=$3&sr=$4 [L]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.