Subfolder

142 views
Skip to first unread message

Archemi

unread,
Sep 15, 2018, 7:48:34 AM9/15/18
to f3-fra...@googlegroups.com
Goodmorning,

I have a question:
my website in HTML has www.example.com
my Fat-free blog is in www.example.com/blog/

My .htaccess is:
RewriteEngine On
RewriteBase /blog/
RewriteRule ^(app|dict|ns|tmp)\/|\.ini$ - [R=404] RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* /blog/index.php [L,QSA] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

In virtualhost I add "FallbackResource /blog/index.php"

In index.php: routes is "/blog/" "/blog/new" or "/" "/new" ?
If I set manual address in browser "www.example.com/blog/new" is found but I click a link set "www.example.com/new"

How can I do?
Thank you
Emilie


------------------------------------------
My configuration
Apache 2.4 (mod_rewrite on)
Ubuntu server

ved

unread,
Sep 15, 2018, 7:58:46 AM9/15/18
to Fat-Free Framework
Hi, have you tried this from the manual:

In case you just put your fat-free project into a sub-folder of an existing document root, some Apache configurations possibly need a defined RewriteBase as well in your .htaccess file. If the app is not working, or the default route / works, but /test maybe fails, try to add the base path:

RewriteEngine On
RewriteBase /fatfree-project/

Archemi

unread,
Sep 15, 2018, 8:34:32 AM9/15/18
to Fat-Free Framework
The solution is add {{@BASE}} before all link in *.htm

bcosca

unread,
Sep 15, 2018, 7:43:51 PM9/15/18
to Fat-Free Framework
DRY.

Use <base href="{{ @BASE }}"> so you don't have to prefix all links.

dyslexicDrakness

unread,
Sep 5, 2019, 5:46:50 PM9/5/19
to Fat-Free Framework

Hello! I'm having the same issue... but the problem is that when you use the ALIAS of routes it goes to root directory:

i.e. $f3->route('GET @install: /install', 'system\installer->wizard');

<form action="{{ 'install' | alias }}" method="POST" name='installform' id='installform'>

becomes:

<form action="/install" method="POST" name='installform' id='installform'>

And so it still goes to root directory your-root.com/install :(

Is there a right way to fix this? or is Archemi's answer the right way?

PJH

unread,
Sep 6, 2019, 4:24:02 AM9/6/19
to Fat-Free Framework


On Thursday, September 5, 2019 at 10:46:50 PM UTC+1, dyslexicDrakness wrote:

Hello! I'm having the same issue... but the problem is that when you use the ALIAS of routes it goes to root directory:

i.e. $f3->route('GET @install: /install', 'system\installer->wizard');

Either
$f3->route('GET @install: '.$f3->get('BASE').'/install', 'system\installer->wizard');
 

<form action="{{ 'install' | alias }}" method="POST" name='installform' id='installform'>

Or

<form action="{{@BASE}}/{{ 'install' | alias }}" method="POST" name='installform' id='installform'>

Not both, though, otherwise you'll end up with a doubled path.

dyslexicDrakness

unread,
Sep 6, 2019, 2:46:49 PM9/6/19
to Fat-Free Framework
On Friday, September 6, 2019 at 2:24:02 AM UTC-6, PJH wrote:


On Thursday, September 5, 2019 at 10:46:50 PM UTC+1, dyslexicDrakness wrote:

Hello! I'm having the same issue... but the problem is that when you use the ALIAS of routes it goes to root directory:

i.e. $f3->route('GET @install: /install', 'system\installer->wizard');

Either
$f3->route('GET @install: '.$f3->get('BASE').'/install', 'system\installer->wizard');
 

<form action="{{ 'install' | alias }}" method="POST" name='installform' id='installform'>

Or

<form action="{{@BASE}}/{{ 'install' | alias }}" method="POST" name='installform' id='installform'>

One detail though is that the install alias already includes the / so it's should be

<form action="{{@BASE}}{{ 'install' | alias }}" method="POST" name='installform' id='installform'>

without the / IMO

Cheers!
Reply all
Reply to author
Forward
0 new messages