HHVM - Rewrite rules for single entry point - hhvm

I'm currentrly testing HipHop virtual machine to deserve a web app. Previously, I was used to run it in a LAMP environement using this htacess file :
Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
# Rules
RewriteRule ^(Templates|Ressources)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
Does anyone could tell me how to configure the VirutalHost in the hhvm.hdf file in ordre to achieve this ?

You can try combination of AllowedDirectories and VirtualHost:
AllowedDirectories {
* = Templates
* = Ressources
}
VirtualHost {
* {
Pattern = .*
RewriteRules {
* {
pattern = ^(.*)$
to = index.php$1
qsa = true
}
}
}
}

Related

Change url estructure htacesss

I've been trying for days to generate a file that modifies the url structure.
I have a current url like this
http://localhost/stores/leo
and I need it to stay like this
https://leo.localhost
Use PHP Server XAMP and Larabel
the word "leo" is generated according to the product and it will always change.
How could you generate it?
Thanks!
I have this code that works but the URL changes in the address bar and does not stay with the desired URL.
RewriteEngine On
RewriteBase /
#force https and non-www
RewriteCond %{HTTP_HOST} ^(www\.)(.+) [OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)
RewriteRule ^ https://%2%{REQUEST_URI} [R=301,L]
# profile redirection
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(.*)\.localhost [NC]
RewriteRule (.*) https://localhost/stores/%1/$1 [L]

How to remove index.php from url in Laravel 5.1?

i am trying to run my project on client's server with the following url:
http://quotes.simplybridal.com/simply-bridal-backend/login // It Gives 404 Not Found Error
But it works for:
http://quotes.simplybridal.com/simply-bridal-backend/public/index.php/login // It works
now, my question is how can we remove this index.php from the url.
here is my .htaccess file content, which i placed outside /public folder:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /simply-bridal-backend/
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Any help would be really appreciated.
Looks like an Apache issue.
Can you post your Virtual Host content (or .htaccess)?
Check your document root variable (that should be something like /foo/bar/public (with no trailing slash)
--
Put this default .htaccess and make sure the route exists and it is reachable.
Options -MultiViews
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

URL Rewrite a Query String

I have Google'ed long for this but can't find an answer.
I have this URL:
www.mysite.com/index.php?tip=1
(respectively www.mysite.com/?tip=1)
And want it to rewrite to:
www.mysite.com/tip/1
Your help would be appreciated.
You will need to enable rewrite module in your apache config and put the following settings on the .htaccess file your base folder
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^tip/(.*) /index.php?tip=$1 [L,NC,QSA]

segment based url not working codeigniter

at this site:
http://www.syriadailynews.com/sdn/
I used codeigniter with segment based url
and it works fine at localhost (xampp)
but after uploded the site, all urls not working
this is my .htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
AddDefaultCharset UTF-8
I edit config.php to this:
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';
It's worked now ! ^_^

Zend Framework 2 without Vhost configuration

I had finished my first web application using Zend Framework 2 and I'm about to put it online.
But may web host doesn't allow me to change my vhost configuration!
The .htaccess file is allowed.
So my question is: How to set up my ZF2 app with only .htaccess files?
Assuming you have a standard ZF2 application based of the skeleton, then try creating a .htaccess file in the root with this in it:
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
I haven't tested this, but in theory, this should effectively move the document root to the public directory while keeping it out of the url.

Resources