Hi,

I am trying to rewrite this URL:
https://maxmon.softnames.com/activate.php?activation_secret=893978102964&customer_guid=7dd3b083-b66e-11e9-aa84-0cc47a4422ec&activation_guid=7dd3b083-b66e-11e9-aa84-0cc47a4422ec
to be like this:
https://maxmon.softnames.com/activate/893978102964/7dd3b083-b66e-11e9-aa84-0cc47a4422ec/7dd3b083-b66e-11e9-aa84-0cc47a4422ec
but it's redirecting to home page which I assume it's 404 but the file is already there if I run it using the normal URL above

How can I fix this issue please?

Here is my .htaccess:

# Disable Directory Listings in this Directory and Subdirectories  
# This will hide the files from the public unless they know direct URLs 
Options All -Indexes

RewriteEngine On

ErrorDocument 404 https://maxmon.softnames.com/

RewriteCond %{HTTP_HOST} ^maxmon.softnames.com[nc]
RewriteRule ^activate/([^/]*)/([^/]*)/([^/]*)\.html$ /activate.php?activation_secret=$1&customer_guid=$2&activation_guid=$3 [L]

([code]...[/code] tags added by moderator, and then added again).

Thanks,

    Someone needs to edit this post again -- the code tags are not formatting the rewrite code properly.

    As for the the htaccess file, the RewriteRule directive looks bad to me. I suspect you are trying to match any sequence of characters that are not a slash with ([/]) but that that's totally wrong because a) the [/] matches only slashes and you don't have a wildcard character in there to match more than one.

    Also, your rewrite rule only rewrites requests that end in .html which your example urls do not.

    You should also consider whether any of these requests might have additional query strings due to session ids or pagination or sorting, etc.

    Maybe try this RewriteRule instead:
    RewriteRule ^activate/([^/]*)/([^/]*)/([^/]*) /activate.php?activation_secret=$1&customer_guid=$2&activation_guid=$3 [L]

    I strongly suggest you make use of a rewrite tool like this one.

      Write a Reply...