You are here:  » Rename /product/ in url

Active Forum Topics


Rename /product/ in url

Submitted by DVDAFFAIRES on Tue, 2019-04-16 07:31 in

Hi David.
I would like to replace the name "product", "review", "brand", "productcategory" in the url as I did in the html version (tapestry.php, .htaccess ...) to have shorter URLs.
exp: https://www.pricetapestry.org/product/xxx.html
>>> https://www.pricetapestry.org/xxx.html

I can not find, as in pricetapestry.php, how to modify this url.

Could you help me ?

Cheers,
Raoul

Submitted by support on Tue, 2019-04-16 08:37

Hello Raoul,

The base HREF values are all configurable in the plugin - from wp-admin > Settings > PriceTapestry.org, under the Virtual section (V3 Beta) you will see the settings each of the Base HREF values...

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Tue, 2019-04-16 09:41

Hi David,

Thank you for your answer.
I already did it.
If, for the "Product Base HREF" line I delete "/product/" and replace it with "/", I get a 404 error.
I of course emptied the caches but without success.

Cheers,
Raoul

Submitted by DVDAFFAIRES on Tue, 2019-04-16 09:44

But for brand, merchant, category, review, it works well: o)

Cheers,
Raoul

Submitted by support on Tue, 2019-04-16 12:55

Hello Raoul,

You can use "/" for the product Base HREF, but you need to edit your WordPress .htaccess file to make it work. To do this, edit the file and look for the RewriteBase line which would be as follows for a WordPress installation in the top level of your site:

RewriteBase /

...and REPLACE with:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?pagename=Shopping&pto_module=product&pto_product=$1 [L]

Double check that the modification hasn't interfered with any other functionality of your site as the rule will match anything ending .html (as long as there isn't actual file or directory of the same name)...

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Wed, 2019-04-17 06:09

Hi David

Everything works well !
thank you very much for your help

Cheers,
Raoul

Submitted by APZ215 on Mon, 2019-04-29 11:00

Hello David,
I tried this and other rewrite options but nothing seems to work.

Is it possible to remove, replace the "productcategory" with a "/" when i also removed the .html from https://www.pricetapestry.org/node/125?

I hope it's possible, here bellow i put the input settings from my wordpress.

I use
{config saved}

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Submitted by support on Tue, 2019-04-30 07:30

Hi,

I checked the site URL you posted and it looks like you have moved the container from Shopping - I just wanted to check that you were looking to try and have:

Comparison home page:
example.com/Shopping

Product page:
example.com/Shopping/Product-Name

Category A-Z
example.com/productcategory/

Category search results (page 1)
example.com/Category-Name

Category search results (page 2, 3 etc.)
example.com/Category-Name/2.html

If that's the case (or otherwise, please let me know!) I will try and work out the .htaccess required on my test server but I'm not 100% sure it would be reliable within a WordPress environment without an identifiable part of the URL (which is the purpose of the slugs e.g. "productcategory"...)

Cheers,
David.
--
PriceTapestry.com