SOLVED! Trying to redirect a url but strip its path data first. Stumped


SOLVED, so no need to reply. :slight_smile: The solution was posted by RoseHosting on Reddit. Figured I’d share the solution. She/he advised me to add the following code to my .htaccess file (swapping out the domain names for my own, of course):

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domaina\.com$ [NC]
RewriteRule ^(.*)$ "" [R=301,L]

My original post:
I currently have a domain forwarding to another, but I’m having trouble removing the path data. For example: forwards to However, if someone visits, they are forwarded to where they get a 404 error (since there’s no other-page on I want to strip away all other url data before forwarding the visitor, so forwards to (without the extra bits). Is there some .htaccess voodoo that will make that happen?

I’m stumped (and an htaccess noob) and hoping someone here can help. Thanks for your help!


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.