1

I have read through a ton of other similar questions and have tried too many combinations of code, but nothing works. I just need to add a single rewrite (not redirect) to my htaccess:

Here is the deal... I have this current URL:

https://example.com/all-categories/202/showCategory/54-Floor-Plans

and I want it to display as:

https://example.com/floor-plans

I still need it to actually be going to the original URL in the background to pull data, but display it differently in the browser URL.

Here is one of the options I tried (didn't work):

RewriteRule ^floor-plans$ all-categories/202/showCategory/54-Floor-Plans [L]

It is probably something extremely simple... HELP PLEASE!

  • I just had a thought... This is all running on Joomla 3.6.5 and I already have the basic internal rewrites going for the entire site so my initial "example.com/all-categories/202/showCategory/54-Floor-Plans" has already re-written once. Could this be causing my newly added specific rewrite rule to not work at all? I'm just fishing for ideas at this point... – Bryan Earl Feb 8 '17 at 20:26
  • do you have 'RewriteEngine On' – Steve Feb 9 '17 at 0:53
  • it also depends where you are putting this directive in the file. Is the URL on the page https://example.com/floor-plans? And what do you mean by "doesn't work" exactly? – MrWhite Feb 9 '17 at 8:30
2

I believe your problem is you're rewriting to a file that doesn't exist.

You'll need to find the non-rewritten URL.

For example:

RewriteRule ^floor-plans$ index.php?option=com_content&view=article&id=54

To find this you could try turning off Search Engine Friendly (SEF) URL's, open the page and check the URL.

You can also read more about SEF URL's here if you wish. https://docs.joomla.org/Search_Engine_Friendly_URLs

  • This led me to the correct solution... I did have to find and use the original, non-sef URL. The issue was me trying to use the already-rewritten URL to re-write a second time. – Bryan Earl Feb 10 '17 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.