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).

Thanks,
Jassim

    Aren't you missing some quotes around the various bits of those directives?

    And I'd also point out that 893978102964/7dd3b083-b66e-11e9-aa84-0cc47a4422ec/7dd3b083-b66e-11e9-aa84-0cc47a4422ec doesn't end in .html.

    In the meantime, look through your server's log files for mod_rewrite's error messages ([rewrite:) for any error messages.

      Which quotes?

      and yes, I don't want to show the html? will that be a problem?

      jrahma

      Your pattern only matches URLs ending with .html (that's what the \.html$ means). That's probably the most significant issue.

      The quotes probably aren't necessary, but when directive arguments get messy they're probably a good idea. Have a look at the mod_rewrite documentation to see them being used. Again, check your logs for any error messages.

      Incidentally, should you be using .htaccess files at all? See When (not) to use .htaccess files.

        Write a Reply...