wordpress how to remove ? from the url using htaccess

会有一股神秘感。 提交于 2019-12-06 14:23:26

问题


i having a URL http://www.domain.com/wp/application/?productname

I want to change it to http://www.domain.com/wp/application/productname . if i have treated like this then page not found error is display. i don't have use of product name in my application page , i want to just show the name of product in URL for SEO. and page should be display the content of application page .

wp is my root folder and application is my page

Please Tell me Any solution htaccess or any plugin

How to remove ? from the URL using Htacccess(Wordpress)

I use following htaccess code. But it is not working for my condition .otherwise all pages are working well

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

回答1:


You need to set your Permalinks structure.

Go to Settings > Permalinks > Check the box 'Post Name', i.e. /%postname%/

If your .htaccess file is not writeable, go to the root of your WordPress installation and add what it tells you to add (The below):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


来源:https://stackoverflow.com/questions/12721074/wordpress-how-to-remove-from-the-url-using-htaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!