skip to Main Content

Renaming file in URL (.php file) – Apache

I have a file called filename-step1.php and looking to make the url domain.com/filename/step1 through .htaccess. My current .htaccess file looks like: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^.]+)$ $1.php [NC,L] At the moment, this works fine for removing the .php…

VIEW QUESTION

RewriteRule with dash or hyphen – SEO

In accordance with the SEO guidelines I am changing pages url from website.com/color_red/ (underscore) to website.com/color-red/ (dash / hyphen) /color-red/ must simply produce ?c=red In .htaccess this works perfectly with underscore: RewriteRule ^color_([^/.]+)/?$ ?c=$1 [L] not with dash: RewriteRule ^color-([^/.]+)/?$…

VIEW QUESTION

.htaccess redirect facebook crawlers except privacy policy

I have a SPA app with dynamic content for sharing on Facebook so I am redirecting Facebook crawlers to a nice static page using the following rule in htaccess: <IfModule mod_rewrite.c> RewriteCond %{HTTP_USER_AGENT} ^facebookexternalhit.*$ RewriteRule ^(.*)$ https://sharing.mysite.tld/api/share/$1 [L] This works…

VIEW QUESTION

htaccess redirect query string, but encoded ? to & – Apache

I want to redirect https://www.aaa.com/query?v=abc123_ABC to: https://bbb.com/?url=https://www.aaa.com/query?v=abc123_ABC I use this in .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ https://bbb.com/?url=https://www.aaa.com/$1 [L,B,NE,NC,QSA,R=301] </IfModule> But the output is: https://bbb.com/?url=https://www.aaa.com/query&v=abc123_ABC The ? was converted into &, what's wrong…

VIEW QUESTION
Back To Top
Search