.htaccess rewrite to redirect root URL to subdirectory

Trying to get www.example.com to go directly to www.example.com/store I have tried multiple bits of code and none work. What I've tried: Options +FollowSymlinks RewriteEngine on RewriteCond...

htaccess rewrite for query string

Ok, im pretty new at this and I would really appreciate some help, thanks! How can i rewrite this in .htaccess correctly? So I have a query string in my url: /?url=contact All i want to do...

Use .htaccess to restrict external access to my Intranet

I'm sure this is possible, but its beyond my meager abilities with .htaccess files. We have an internal php app that we use, we have basic security internally, but dont need to worry too much. I...

how to change php version in htaccess in server

I'm using php 5.3 on my local machine. On our webserver we have php 4.8. Our server is a shared server. So I want to change the php version on our server via .htaccess file. Is it possible to do...

Password protect a specific URL

The site is on shared hosting. I need to password protect a single URL. http://www.example.com/pretty/url Obviously that's not a physical file path I'm trying to protect, it's just that...

'hash' url rewrite in .htaccess

I want to rewrite http://example.com/articles.html#first-article with http://example.com/articles/first-article Is it possible to rewrite? I tried using following but didn't work for...

What is L in [QSA, L] in htaccess

QSA means that if there's a query string passed with the original URL, it will be appended to the rewrite (olle?p=1 will be rewritten as index.php?url=olle&p=1. L means if the rule matches, don't...

Configure apache on elastic beanstalk

I'm developing with django on elastic beanstalk and I want to make two changes to apache configuration: redirect www.domain.com to domain.com redirect http://domain.com to...

Rename WordPress admin URL wp-admin

I want to rename the admin URL 'wp-admin' to e.g. 'admin'. I set a rewrite rule in the .htaccess to acces the admin login: RewriteRule ^admin wp-admin [NC,L] That works but I can still use...

Change Wordpress Admin URL

I changed my Wordpress directory structure quite a bit. Here's what I have: define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress'); define('WP_HOME', 'http://' ....

htaccess "Satisfy Any" not working

I have enabled htpasswd authentication for my website, so the website need a username / password to be accessed. Now I need to allow one url without authentication, when i use "Satisfy any"...

.htaccess 301 redirect when %20 is in old url

I want to redirect old url to new url but my url having "%20" between character like this http://www.mydomainname.com/davey%20pumps.htm This is old url and i want 301 redirection for this url to...

Using htaccess remove folder name

my project is in core PHP with some folder structure which contain views folder but I do not want to show it so I have tried a lot in htaccess but not get success I want url...

Wordpress URL not working

I am using wordpress, i have some URL issue. My current URL is IP address on server: http://www.192.10.1.22/states/?q=ohio I want URL :http://www.192.10.1.22/states/ohio i used following code in...

Redirect http to https in laravel 5.2

I have a Laravel 5.2 project. Recently, I installed an SSL certificate on my website so when I type https://example.com in the browser it works but when I write example.com, it connects by...

htaccess: 404 Not Found Error While trying ErrorDocument

I'm using .htaccess file to redirect to error pages if error occured but error not found. I'm test if the error.php pages are working but the following result I got. The 404 Not Found error was...

Strip parent categories from url

I'm struggling to fix an issue with 301 redirects and .htaccess. I have moved a site from an old domain to a new domain. And I have successfully managed to do this with a 301 redirect. Like...

Font not loading - CORS says header contains no Access Control but there is

The problem: I am using html generated from one site that is being pushed to another site (different domains). All is working well except the font (used mainly for icons) is not showing up. I am...

Htaccess force https except on one url doesn't work

I try to force all my website to https. So I did: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php RewriteCond...

.htaccess file preventing css from loading

I am new to .htaccess files and have been trying to do a few simple rewrites on my site. However this has caused an issue loading all of the other resources on the domain specifically my...

How to block a specific website browser agent?

Lately i'm facing some issues with a data mining bot, extracting data from my website everyday at certain hours of the day. This will not only waste my bandwidth but also giving wrong data to my...

WordPress internal Server Error 500 when moving hosts

I am trying to move my WordPress site from one hosting service to another. I made a backup and restored it on the new host. But I am getting internal server 500 error on the site. I have tried to...

Next.js index route returns 404

I got a problem to get my nextjs app running on my production server. I portforward it via htaccess by following code: RewriteRule ^(.*) http://127.0.0.1:1338/%241 Every route is working...

Next.JS - `.htaccess` file?

I'm just starting out with my first Next.JS app. I've used npx create-next-app and have made a few pages, when I realized that I'm not sure how to use a .htaccess file. I'm used to Apache taking...

How to enable browser cache on nginx?

I tried to analyze web speed with PageSpeed Insights and Google told me that I need to enable cache. So I added to my .htaccess: <IfModule mod_expires.c> <FilesMatch...

Where should I redirect hackers / hacking scripts to?

Some hacker has been annoying me today by succesfully altering my database with a certain type of DOM injection, using automated scripts. I fixed my website, but on top of that I want to redirect...

How to deploy a nextjs application on cpanel?

I followed these steps to deploy my nextjs on cPanel. go to package.json and add this line: "homepage": "http://afsanefadaei.ir" run next build to have .next folder as my build folder go to...

How do I stop my .htaccess file get updated automatically?

I'm using wordpress genesis theme. My .htaccess code was below. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond...

How to rewrite URLs from UPPERCASE to lowercase in .htaccess

I'm trying to assemble a regular expression to rewrite a URL containing uppercase characters to the same URL but in all lowercase. Example: example.com/foO-BAR-bAz rewrite to...

Strange wp-admin login issue with redirect and reauth=1

I cannot login to the admin account on my wordpress site from the normal link: https://www.my_site.com/wp-admin. Every time I load https://www.my_site.com/wp-admin in the browser, the URL is...