2 Replies - 154 Views - Last Post: 05 August 2019 - 10:02 AM

#1 jrahma   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 11-January 14

Why my htaccess is not working?

Posted 04 August 2019 - 12:40 PM

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]



Thanks,
Jassim

Is This A Good Question/Topic? 0
  • +

Replies To: Why my htaccess is not working?

#2 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6820
  • View blog
  • Posts: 31,436
  • Joined: 10-May 07

Re: Why my htaccess is not working?

Posted 04 August 2019 - 07:32 PM

** Topic moved to Web Servers & Hosting **

Not saying that it can't be done, but I've never seen the 404 document called from the htaccess file. It's normally in your apache/nginx configs. If it is erroneous, it could be canceling out the rewrites. If this were my project, I would remove that line to test your redirect.
Was This Post Helpful? 0
  • +
  • -

#3 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2397
  • View blog
  • Posts: 7,292
  • Joined: 15-January 14

Re: Why my htaccess is not working?

Posted 05 August 2019 - 10:02 AM

Your rule expects a ".html" at the end of the URL also.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1