I have a static HTML page and I'm converting it to CMS Concrete5, the URL of this page has an ampersand '&'
in it, so what I want is make the new URL in CMS the same as the static HTML page.
The desired page URL is www.domain.com/Fitness/WT&End
When I was creating the page, I tried to put the '&'
in the URL slug but it gets converts it to a hyphen -
I also tried to put %26
in the URL slug but it gets converted to '-26'
. I also tried &
and also it didn't work and gets converted to -amp
I searched for previous questions on the same topic, some people said to try http://php.net/urlencode or http://php.net/rawurlencode, but I'm not sure how to do that because my PHP knowledge is limited
The function that I want is to let me create a page with this URL www.domain.com/Fitness/WT&End
without converting the &
to any other characters
Edit:
this is the code inside the .htaccess file
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /concrete/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --
You can use urlencode as following:
public function encode_url($url){
reuturn urlencode($url);
}
and then making call to this function by passing your url as
$new_url=encode_url("your url");