[EXPLAINED] About rewriting URLs that use ID-ALIAS

More
8 years 9 months ago - 8 years 9 months ago #60236 by seabird
Hello,
I just noticed acces to incorrect url.
For example: I have a category with id= 9.
In my logs, I see attempt access to:
index.php?option=com_flexicontent&cid=9.php&view=category
index.php?option=com_flexicontent&cid=9gdgfdgfdgdg.php&view=category
index.php?option=com_flexicontent&cid=9.html&view=category
.....
All these urls launch index.php?option=com_flexicontent&cid=9&view=category and created me duplicate content when rewriting.

I want filter by htaccess with regex and I detect cid be a integer.
So I write:
Code:
RewriteCond %{QUERY_STRING} .*(cid=.*[a-zA-Z.:;]+.*&view=category).* [NC] RewriteRule .* accessdenied.php [L]
Is that right ?
Thanks,
Eric
Last edit: 8 years 9 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #60256 by ggppdk
Hello

all URLs with any text AFTER the ID are valid
- e.g. you change the alias, the URLs will change but OLD bookmarked URLs will continue to function

you may add HTACCESS directives to rewrite them,
- but i recommended that you do not invalidate them, but directing the to the non-found 404 page


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.412 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline