Redirect to www and eliminate fb_xd_fragment

I've been trying all all day to combine these two rewrites into just one -or get both to work consecutively-. They work perfectly well on their own, but not together.

I need to redirect in apache all access to a website to a "www" subdomain, and at the same time I need to eliminate the "fb_xd_fragment" added by facebook; while keeping intact any other query strings.

This are the two separate pieces:

RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1


RewriteCond %{QUERY_STRING} ^(.*)fb_xd_fragment(=)?$
RewriteRule (.*) %{REQUEST_URI}?%1  [R=301,L]

Elgg 1.8.19 isn’t sending validation emails with Postfix

I'm developing a social networking site using Elgg 1.8.19 on a Digital Ocean VPS that runs Ubuntu 13.10 and Postfix 2.10.2.

Elgg isn't sending validation emails to users, whether they have just registered or whether the validation emails are resent by the administrator. Has anyone has this problem before and know of a solution?

I've manually confirmed Postfix is working by telnet'ing to port 25 and sending from there.

telnet localhost 25
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP Postfix (Ubuntu)
ehlo localhost
250-SIZE 10240000
250 DSN
mail from: [email protected]
250 2.1.0 Ok
rcpt to: [email protected]
250 2.1.5 Ok
354 End data with <CR><LF>.<CR><LF>
testing email for stackoverflow
250 2.0.0 Ok: queued as 795AC120025
221 2.0.0 Bye
Connection closed by foreign host.

I've also successfully run a PHP script to test the mail() function with the following:

$to = "[email protected]";
$header = "From: {$to}";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body, $header)) {
    echo("<p>Message successfully sent!</p>");
} else {
    echo("<p>Message delivery failed...</p>");

For reference, here's my Postfix

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =, localhost, localhost.localdomain, localhost
relayhost = 
mynetworks = [::ffff:]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

I've been hitting Google and the Elgg Community discussion boards all day to no avail, as most posts refer to As far as that goes, it refers to php.ini configuration options that are already set. Any ideas where to look/solutions?

Subdomains Always Redirect To Main Domain – Apache2 VirtualHosts & Debain

I want to set up a main site, and a sub-domain for development, using apache2 VirtualHosts. This is what my site.conf virtual host file looks like:

<VirtualHost *:80>

        DocumentRoot /var/www/site/subdomain
        <Directory /var/www/site/subdomain >
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel debug

        CustomLog ${APACHE_LOG_DIR}/sub.log combined

<VirtualHost *:80>

        DocumentRoot /var/www/site/main
        <Directory /var/www/site/main >
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

The problem is that every time I visit, I just get

There's no htaccess for the main site, and the .htaccess for the sub-domain looks like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

I've tried all the other solutions I could find (using literal IPs, re-ordering things, using ports instead of named hosts)... I'm totally stuck now. The site is enabled of course. Anyone got any ideas?

apache is not allwing me to use port number 443 in virtual tag for configuring apache for https service

i am trying to configure apache for https service in xampp , i am almost done i am jsut struggling with that virtual tag in which i have give information about my self-signed ssl-certificate and key file , apache is not allowing me to use port number 443 in virtual tag even though i have no other service is running on this port , instead its working very well with any other free port like 55000

<VirtualHost *:443>
# Server Certificate:
SSLCertificateFile "C:/xampp/apache/bin/mycert.crt"
# Server Private Key 
SSLCertificateKeyFile "C:/xampp/apache/bin/mykey1.key"
SSLEngine On
ServerName localhost
DocumentRoot "C:/xampp/htdocs"

500 Internal Server Error error was encountered laravel on hosting

I can't access my site. '500 Internal Server Error error was encountered' this error occur when i try to access my root domain like

My .htaccess file:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ /index.php [L]

Please help me.

no login prompt in .htaccess from browser

I'm trying to protect a directory (/var/www/html/user) using .htaccess. The directory basically has index.php which renders an html page as follows:


if(isset($login)) {
// Output HTML content
else {
echo "
User not recognized!

My .htaccess file is:

AuthName "IT web"
AuthType Basic
AuthUserFile /remote/wwwin/LDAP_DB/dir-user-passwd
<Files index.php>
require valid-user

When I try to access index.php from the browser, I do not get a prompt to login and the html in the else condition is displayed (i.e, User not recognized!)

Server version: Apache/2.2.3

I have also verified in the httpd.conf file that

AccessFileName .htaccess

Would be grateful if someone can help me identify the issue.


<a href> appends link to end of current url

So whenever I upload a .html file to my website and have tags the new url the link brings the user to appends the link to the end of the current url. For example, if my website was and the index.html file was placed in and the link was then the link would bring me to How do I make it so the a href tag brings me to in this case.

Thank you!