htaccess rewrite rules

Here is an example of .htaccess rewrite rules to redirect your old URLs to new URLs:


```php RewriteEngine on

For categories ####

RewriteCond %{query_string} idCategory=1234

RewriteRule (.*) yourdomain.com? [R=301,L]


For products ###

RewriteCond %{query_string} idproduct=1234

RewriteRule (.*) yourdomain.com? [R=301,L] ```

Hi everybody,



There are few products that I added in “second category” and now I would like to delete the second category and move all the those product to another subcateogry, something like this:



product1 it is in [COLOR=red]maincategory:[/COLOR]

[COLOR=#ff0000][/COLOR]

www.domain.com/[COLOR=red]maincategory[/COLOR]/product1.html



the same product1 also was showing on second category



Now I would like to delete th second category and show the Product1 to a new subCategory under [COLOR=red]maincategory[/COLOR]



How to use the 301 Redirect on .htaccess



Thank you








[quote name=‘indy0077’]Here is an example of .htaccess rewrite rules to redirect your old URLs to new URLs:


```php RewriteEngine on

For categories ####

RewriteCond %{query_string} idCategory=1234

RewriteRule (.*) yourdomain.com? [R=301,L]


For products ###

RewriteCond %{query_string} idproduct=1234

RewriteRule (.*) yourdomain.com? [R=301,L] ```[/quote]

Hi Indy007,

I need your help. please…

I would like to remove “.html” extension to only two pages. I tried to redirect with CPanel but it did not work for me.



My requirement is like this.



From: www.domain.com/page1.html redirect to www.domain.com/page1

From www.domain.com/page2.html redirect to www.domain.com/page2



Please HELP!..

[quote name=‘Raj’]I would like to remove “.html” extension to only two pages. I tried to redirect with CPanel but it did not work for me.



My requirement is like this.



From: www.domain.com/page1.html redirect to www.domain.com/page1

From www.domain.com/page2.html redirect to www.domain.com/page2



Please HELP!..[/QUOTE]



Use the SEO rules in admin.