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
Back To Top
Search