santa
santa

Reputation: 12512

.htaccess URL rewrite to point to ajax file

I'm struggling to add a rewrite rule to my .htaccess file.

I need the URL stings in this format:

/myFile.ajax

to point to this:

/include/dir/ajax.myFile.php  

Here's where I am:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+include/dir/ajax\.([^.]+)\.php[/\s?] [NC]
RewriteRule ^ /%1\.ajax? [R=302,L]

Not sure what I'm missing.

Upvotes: 2

Views: 52

Answers (1)

Jon Lin
Jon Lin

Reputation: 143876

Try also adding:

RewriteRule ^([^/]+)\.ajax$ /include/dir/ajax.$1.php [L]

Upvotes: 2

Related Questions