htaccess redirect to WordPress – 404

Good afternoon,
I am having an issue with wordpress. I access to page123.domain.com and the .htaccess redirects it to domain.com/wordpress?pagename=page123.
Then i get the wordpress 404 page. I made a die(print_r($_GET)) and it writes

Array ( [pagename] => page123 )

Read More

My question is : if I access directly to wordpress?pagename=page123 it works, why this is not working properly?
Do I have to edit some of the wordpress php files?

Related posts

Leave a Reply

2 comments

  1. This only can be related with 3 root causes:

    • your .htaccess file
    • wordpress plugin that is rewriting the get variable based on the subdomain
    • a rewrite directive of you host company (RewriteOptions Inherit), or another apache directive that is taking control

    You need to specify if this print_r($_GET) is on the theme, or on wordpress index.php(accurate since its the starting point) and check your .htaccess (it can be inherited)

  2. I have solved this issue. After spending some time searching for an answer for this matter, i have noticed that the $_SERVER['REQUEST_URI'] was sligtly different than what it was supposed to be (instead of /devl2t/index.php/?pagename=teste was only /devl2t).
    So the resolution was to manually edit the $_SERVER[‘REQUEST_URI’] on the index.php