Shahryar Posted December 14, 2018 Share Posted December 14, 2018 (edited) Hello guys, I'd tried to enable Friendly URL option in Search Engine Optimization settings, but after activate and placing the htaccess file in the server, all posts, pages and forums show me " The page you requested does not exist". I'd enabled three options in "Friendly URL" tab. what is the problem? help me plz. Edited December 14, 2018 by Shahryar Link to comment Share on other sites More sharing options...
0 mr-pimpen Posted December 14, 2018 Share Posted December 14, 2018 is mod security off on your server and you have the>>> .htaccess 1 when I load your site, I was like a vampire, slept for thousands of years and just now is my first glimpse of light haha. Link to comment Share on other sites More sharing options...
0 Shahryar Posted December 14, 2018 Author Share Posted December 14, 2018 (edited) i think mod_security is not installed. this is my htaccess content: <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> Oh, I forgot to say that my forum is located in subdomain. subdomain name is "forums" and web address is like "https://forum.domain.com". Edited December 14, 2018 by Shahryar Link to comment Share on other sites More sharing options...
0 mr-pimpen Posted December 14, 2018 Share Posted December 14, 2018 1 hour ago, Shahryar said: i think mod_security is not installed. this is my htaccess content: <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> Oh, I forgot to say that my forum is located in subdomain. subdomain name is "forums" and web address is like "https://forum.domain.com". .htaccess so this is in a subdomain check your server and see what the issues sounds like is sever side if you have your .htaccess did u add the . in the front oh your file when I load your site, I was like a vampire, slept for thousands of years and just now is my first glimpse of light haha. Link to comment Share on other sites More sharing options...
0 Jeffrey Posted December 14, 2018 Share Posted December 14, 2018 (edited) Here's an example for the Rewrite Rule for subdomains: RewriteCond %{HTTP_HOST} !^www.example.com$ RewriteCond %{HTTP_HOST} ^blog\.example.com$ RewriteRule ^/(.*) http://blog.example.com/index.php/$1 [L, QSA] Edited December 14, 2018 by Jeffrey Support Team - September 9th, 2017 - June 8, 2018 Junior Moderator - December 14th 2018 - November 16th, 2019 Designer - November 16th, 2019 - June 5th, 2020 Moderator - June 5th, 2020 - August 28th, 2020 Link to comment Share on other sites More sharing options...
0 Cookie Monster Posted December 15, 2018 Share Posted December 15, 2018 Have you checked if you are using apache or nginx? If it's nginx the htaccess won't work and you need a different redirect method Liked what i posted remember to feed me a cookie ->Or you can add a cookie to my Link to comment Share on other sites More sharing options...
0 Shahryar Posted December 15, 2018 Author Share Posted December 15, 2018 (edited) 12 hours ago, Jeffrey said: Here's an example for the Rewrite Rule for subdomains: RewriteCond %{HTTP_HOST} !^www.example.com$ RewriteCond %{HTTP_HOST} ^blog\.example.com$ RewriteRule ^/(.*) http://blog.example.com/index.php/$1 [L, QSA] No, it doesn't work. 1 hour ago, Cookie Monster said: Have you checked if you are using apache or nginx? If it's nginx the htaccess won't work and you need a different redirect method we use nginx reverse proxy and apache. Can this be the problem? Edited December 15, 2018 by Shahryar Link to comment Share on other sites More sharing options...
1 Cookie Monster Posted December 15, 2018 Share Posted December 15, 2018 12 minutes ago, Shahryar said: No, it doesn't work. we use nginx reverse proxy and apache. Can this be the problem? Well if your using Nginx that means you need to setup nginx first as the .httaccess you are using only works for apache. That information is quite critical to give next time you ask for help and something is not working btw. The httaccess file you have would be this in nginx # nginx configuration location / { if (!-e $request_filename){ rewrite \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php break; } if (!-e $request_filename){ rewrite ^(.*)$ /index.php break; } if ($http_host !~ "^www.example.com$"){ rewrite ^/(.*) http://blog.example.com/index.php/$1 [L, QSA] redirect; } } That is taken also what @Jeffrey into account. Please do use with care and remember to modify to your needs 1 Liked what i posted remember to feed me a cookie ->Or you can add a cookie to my Link to comment Share on other sites More sharing options...
0 Shahryar Posted December 15, 2018 Author Share Posted December 15, 2018 (edited) 2 hours ago, Cookie Monster said: That information is quite critical to give next time you ask for help and something is not working btw. Sorry, I forgot it. I added this code to Custom HTTPD Configurations in directadmin, but it show me an error. The error is: nginx: [emerg] invalid number of arguments in "rewrite" directive in /usr/local/directadmin/data/users/admin/nginx.conf:21 nginx: configuration file /etc/nginx/nginx.conf test failed The code I entered is: location / { if (!-e $request_filename){ rewrite \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php break; } if (!-e $request_filename){ rewrite ^(.*)$ /index.php break; } if ($http_host !~ "^www.mydomain.com$"){ rewrite ^/(.*) https://forums.mydomain.com/index.php/$1 [L, QSA] redirect; } } The problem seems to be this: rewrite ^/(.*) https://forums.mydomain.com/index.php/$1 [L, QSA] redirect; Edited December 15, 2018 by Shahryar Link to comment Share on other sites More sharing options...
0 Shahryar Posted December 15, 2018 Author Share Posted December 15, 2018 finally i found the damn problem. The problem was with php 7.3. I returned it to the previous version and the problem seems to have been resolved. 1 Link to comment Share on other sites More sharing options...
0 Jeffrey Posted December 16, 2018 Share Posted December 16, 2018 The question(s) in this support topic have been answered and the topic author has resolved their issue. This topic is now closed. If you have other questions, please open a new topic. 1 Support Team - September 9th, 2017 - June 8, 2018 Junior Moderator - December 14th 2018 - November 16th, 2019 Designer - November 16th, 2019 - June 5th, 2020 Moderator - June 5th, 2020 - August 28th, 2020 Link to comment Share on other sites More sharing options...
Question
Shahryar
Hello guys,
I'd tried to enable Friendly URL option in Search Engine Optimization settings, but after activate and placing the htaccess file in the server, all posts, pages and forums show me " The page you requested does not exist".
I'd enabled three options in "Friendly URL" tab.
what is the problem?
help me plz.
Edited by ShahryarLink to comment
Share on other sites
10 answers to this question
Recommended Posts