0

I want redirect my old url to new url the redirection is working fine but there is an issue in url, the redirected url is not in proper way

For Example :

Old url :www.example.com/pages/product_popup/1

New url : www.example.com/product-syrup

But it is redirecting in this way

Redirected url : www.example.com/product-syrup/?/pages/product_popup/1

My htaccess:

RewriteOptions inherit
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]


Redirect 301 /pages/product_popup/1 /product-syrup/



## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

How can i overcome this? Am using GoDaddy hosting

2 Answers 2

2

After RewriteEngine On in new line add this rule:

RewriteRule ^pages/product_popup/1$ /product-syrup [R=301,L]
Sign up to request clarification or add additional context in comments.

Comments

0

In codeigniter you can do this by URI Routing

Under application / config / routes.php

$route['pages/product_popup/(:any)'] = 'product-syrup';

A URL containing the word “pages/product_popup/(:any)” will be remapped to the “product-syrup” class.

https://www.codeigniter.com/userguide3/general/routing.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.