Skip to content

A simple way to strat php site in your localhost for good project, including 'core.php' in all header.php and header in all respective page, you will make rour website easy to manage

Notifications You must be signed in to change notification settings

erilshackle/phplocal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phplocal

A simple way to strat php site in your localhost for good project, including 'core.php' in all header.php and header in all respective page, you will make your website easy to manage

Create a .htacces in the root folder and paste this:

RewriteEngine On

# Redireciona URLs que começam com /uploads/ para file.php 
RewriteCond %{REQUEST_URI} ^/uploads/(.*)
RewriteRule ^uploads/(.*)$ uploads/file.php?name=$1 [NC,QSA,L]

# Redireciona todas as outras requisições para a pasta /public/
RewriteRule ^(.*)$ /public/$1 [L]

Create another .htacces, now in the public folder and paste this:

RewriteEngine On

# dissalow access to assets folder, but not files
RewriteCond %{REQUEST_FILENAME} assets(.*)/$
RewriteRule ^(.*)$ / [R=404,L]

# call the page but not showing /public/ in the url
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]

RewriteCond %{THE_REQUEST} -d
RewriteRule ^((?!public/).*)$ $1 [L,NC]


# Página 404 para arquivos não encontrados
ErrorDocument 404 /404.php

About

A simple way to strat php site in your localhost for good project, including 'core.php' in all header.php and header in all respective page, you will make rour website easy to manage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published