Question

How can I make this link(s)

http(with or without s)://(with or without www).puaction.com/articles/Top-7-Best-Pheromone-Colognes-for-Men

looks like this :

https://puaction.com/Top-7-Best-Pheromone-Colognes-for-Men

each folder inside articles directory will displayed without the article directory so...

http(with or without s)://(with or without www).puaction.com/articles/(any article)

will be (non www / https / article directory will not be displayed by the end user)

https://puaction.com/ {any article name}
Was it helpful?

Solution

You can use this code in root .htaccess:

RewriteEngine On

RewriteCond %{THE_REQUEST} \s/+articles/([\S+) [NC]
RewriteRule ^ https://puaction.com/%1? [R=301,L,NE]

RewriteRule ^([^/.]+)/?$ /articles/$1 [L]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top