Change URL in localhost (.htaccess)

0

I would like to change the URL of my local server. I use XAMPP.

I believe you need to create or change .htaccess . In fact, I have already created the file and placed it in the root of the localhost, that is, in the htdocs directory.

I would like to make the following change:

From: link

To: link

That is, I would like to remove the / src / and / php / directories from the URL. can you help me?

I did not understand the other post similar to this one. I'm not sure, but to change the .htaccess it takes a notion of RegEx that I need.

Thank you!

    
asked by anonymous 19.09.2018 / 01:56

1 answer

0

Richard, good morning.

Try the following at the root of htdocs, you need to create a .htaccess and put the code.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ src/php/$1 [L]

Comment it if it worked.

    
19.09.2018 / 15:11