
Untitled
By: a guest on
Jun 17th, 2012 | syntax:
None | size: 0.59 KB | hits: 16 | expires: Never
PHP: mod_rewrite if query contains value
/
/index.php
/content/
/content/styles.css
/domain/
/domain/index.php
<link rel="stylesheet" type="text/css" href="content/styles.css" />
RewriteRule ^([^/]+)$ /content/$1 [NC,L]
<VirtualHost *:80>
DocumentRoot "/domain"
Alias /content "/content"
</VirtualHost>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
$dir = dirname(__FILE__);
$link = $_SERVER['HTTP_HOST'];
// $link = preg_replace('/^www./i', '', $link);
href="<?php echo $link . '/content/content.css'; ?>"
include($dir . '/example.php');