# Replace url of css, scripts and icon files with fullBaseUrl instead of prepending it in cakephp 4.3

**URL:** <https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953>\
**Category:** Need Help\
**Created:** [December 2, 2021, 6:50pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953 "2021-12-02T18:50:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdeanquin](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mdeanquin/32/1802_2.png) [@mdeanquin](https://discourse.cakephp.org/u/mdeanquin)\
**Post date:** [December 2, 2021, 6:50pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/1 "2021-12-02T18:50:18Z")

</div>

How can I replace instead of prepending the url with fullBaseUrl?  
I have this url: [http://www.trayectos.efn.uncor.edu/web/sistemas/trayectos/](http://www.trayectos.efn.uncor.edu/web/sistemas/trayectos/), but what I want to have is only [http://www.trayectos.efn.uncor.edu/](http://www.trayectos.efn.uncor.edu/), I put the option [‘fullBase’ =\> true], what do I have to put so that it shows only as i want?

---

<div class="post-metadata">

**Author:** ![mdeanquin](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mdeanquin/32/1802_2.png) [@mdeanquin](https://discourse.cakephp.org/u/mdeanquin)\
**Post date:** [December 2, 2021, 11:02pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/2 "2021-12-02T23:02:57Z")

</div>

Or maybe I have to put RewriteBase in .htaccess, but I don’t know what is the root directory of the app.  
The site is uploaded to /var/www/html/web/sistemas/trayectos/

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [December 3, 2021, 4:00pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/3 "2021-12-03T16:00:11Z")

</div>

You should have your web server set up such that that DocumentRoot (or equivalent, if you’re not using Apache) points directly to the `webroot` folder of your application (presumably, `/var/www/html/web/sistemas/trayectos/webroot`, and then you shouldn’t need to change anything at all about URL settings from the defaults. Looks like you’ve got it pointed just to ` /var/www/html` right now.

---

<div class="post-metadata">

**Author:** ![mdeanquin](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mdeanquin/32/1802_2.png) [@mdeanquin](https://discourse.cakephp.org/u/mdeanquin)\
**Post date:** [December 3, 2021, 7:46pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/4 "2021-12-03T19:46:06Z")

</div>

Should I configure something else?  
When I put the url ([http://www.trayectos.efn.uncor.edu](http://www.trayectos.efn.uncor.edu)) it changes to [http://172.18.64.7/web/sistemas/trayectos/webroot/](http://172.18.64.7/web/sistemas/trayectos/webroot/)

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [December 3, 2021, 9:01pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/5 "2021-12-03T21:01:25Z")

</div>

If it’s changing the domain name into an IP address, that really looks like a problem with either `.htaccess` (but you should be using the standard version of that, as far as I can tell) or with your vhost setup in Apache (or whatever). Maybe share that configuration?

---

<div class="post-metadata">

**Author:** ![mdeanquin](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mdeanquin/32/1802_2.png) [@mdeanquin](https://discourse.cakephp.org/u/mdeanquin)\
**Post date:** [December 3, 2021, 9:51pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/6 "2021-12-03T21:51:53Z")

</div>

Instead of vhost is used apache redirect that is hosted in a server that I don’t have access, how should I configure cakephp to use apache redirect?

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [December 3, 2021, 10:17pm UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/7 "2021-12-03T22:17:48Z")

</div>

I understand what all those words mean by themselves, but don’t understand the meaning behind this particular grouping. 🙂

If it’s “Apache redirect that is hosted in a server that I don’t have access”, then how can you “configure CakePHP to use Apache redirect”? And how is the redirect on that server configured, if not in a vhost?

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [December 4, 2021, 9:37am UTC](https://discourse.cakephp.org/t/replace-url-of-css-scripts-and-icon-files-with-fullbaseurl-instead-of-prepending-it-in-cakephp-4-3/9953/8 "2021-12-04T09:37:49Z")

</div>

As Zuluru already said the connection between the domain and how your website is being accessed is configured in apache.  
Its called the “docroot” and basically connects which absolute filepath is being shown when [mydomain.com](http://mydomain.com) is being called.

So this is not something you can change in cakephp, its something the webserver admin needs to change.

You need to be able to put a `info.php` in the webroot folder of cakephp, put

```auto
<?php phpinfo();

```

in there and call it via [https://yourdomain.com/info.php](https://yourdomain.com/info.php)

If the webserver is not configured that way you will not get the result you want.
