Forum Moderators: phranque
RewriteEngine on
RewriteRule ^/friendfinder /personals [NC,L]
RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteRule ^/personals/([^/]+) /personals/view.php?perma=$1 [QSA,NE,NC,L]
# I originally had this instead of the above, but I'm not sure that I have to specify both since I redirect earlier anyway
#RewriteRule ^/(?:friendfinder|personals)/([^/]+) /personals/view.php?perma=$1 [QSA,NE,NC,L] [Tue Dec 20 15:34:43.027165 2022] [proxy_fcgi:error] [pid 9622:tid 47549292066560] [client 123.45.67.89:28440] AH01071: Got error 'Unable to open primary script: /home/example/www.example.com/personals/view.php (No such file or directory)' <?php
echo "Done";
?> RewriteEngine on
RewriteRule ^/classifieds/[\w-]+?/(\d+)/?$ /classifieds/view/index.php?id=$1 [QSA,PT] RewriteEngine on
RewriteRule ^/personals/([^/]+) /personals/view.php?perma=$1 [R=301]
I wanted to set it up so that if a user goes to example.com/personals/foo or example.com/friendfinder/foo, they'll see the results for example.com/personals/view.php?perma=foo.
RewriteRule ^personals/foo$ /personals/view.php [L] just a misunderstanding between redirect and rewrite?That was my first thought too. But I think what csdude was doing was testing the RewriteRule by first making it an external redirect, to make it easier to see what's happening--it's right there in the browser's address bar, not hidden in server logs--and then changing it back to the internal rewrite shown in the original post.
if a user goes to example.com/personals/foo or example.com/friendfinder/foo, they'll see the results for example.com/personals/view.php?perma=foo
If I go to example.com/personals/view.php then I get the expected result, so it DOES exist.
I also tried changing [L] to [PT], and tried adding R=301 to see if I can narrow down what's happening. But I still get the same error.