Best way to redirect site in subdirectory to root?

The only way I managed to get this to work was with the following in the .htaccess of the /site/ directory: RewriteBase \ RedirectMatch 301 ^/site/$ /$1 RedirectMatch 301 ^/site/(?!wp-admin/|wp-content/|wp-includes/)(.*)$ /$1 Whilst I am aware that RewriteRule ^site/ /$1 [R=301,NC,L] should have worked, and that RewriteRule ^site/(.*)$ /$1 [R=301,NC,L] should have also worked (according to … Read more

WordPress On subfolder

Maybe try something like this.. .htaccess on your root: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress .htaccess inside your /wordpress/ directory: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ – [L] RewriteCond … Read more

301 Redirect Loop

I think there is some issue with openshift’s php hosting. I found this thread on stackoverflow. So catch is you append port no after host. This .htaccess code should work. RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule (.*) http://www.example.com:80/$1 [R=301,L]

404 with post name permalinks

I was able to figure out the problem, and for the sake of posterity, I’m posting the answer here. Basically, the new apache2.conf file that was added when I updated my web server had the following lines in it (my document root is /var/www): <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> … Read more

Redirect all pages except one to homepage via .htaccess

Problems I get too many redirect: all urls redirect infinitely to themselves, why? Apache rewrite rules are processed top-to-bottom, so your custom rewrite rule is always processed first. The R redirect flag instructs Apache to tell the browser to make a new request to the altered URL instead of serving the destination of the rewrite … Read more

Allow logged in users who doesn’t belong to whitelisted ips

Simple & Fast but not 100% secure method: This method is not 100% secure, but for most users (like 99%), it’ll work. Here, basically you’ll use a .htaccess file inside the restricted directory, say: /var/www/html/link with the following CODE: SetEnvIf Cookie “^.*wordpress_logged_in.*$” WP_LOGGED_IN=maybe Order allow,deny Require all granted # Our Network #Allow from ip-address/22 #Allow … Read more

htaccess 301 redirect http to https doesn’t work

You’ve put the redirect code in the wrong place. It needs to go before the # BEGIN WordPress section. By placing the redirect code after the WordPress front-controller it will never be processed unless the request is for a physical file. However, your first attempt is not correct (it’s missing the check for HTTPS), so … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)