2012-10-04 131 views
1

我有一個網址http://www.domain.com/wp/application/?productnamewordpress如何刪除?從URL使用htaccess

我想將其更改爲http://www.domain.com/wp/application/productname。 如果我有這樣的待遇然後頁面未找到錯誤顯示。 我沒有在我的應用程序頁面中使用產品名稱, 我想只顯示SEO中產品的名稱。 頁面應該顯示應用頁面的內容。

WP是我的根文件夾和應用程序是我的網頁

請告訴我任何解決方案的htaccess或任何插件

如何去除?從URL使用Htacccess(Wordpress)

我使用以下htaccess代碼。但它不適用於我的情況。其他所有頁面都工作正常

<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

不知道你是問題是,你說你正在使用以下代碼,但我沒有看到任何問題。 –

+0

可能是Apache2 URL重寫未啓用。 – nalply

回答

1

您需要設置您的固定鏈接結構。

轉到Settings > Permalinks > Check the box 'Post Name', i.e. /%postname%/ enter image description here

如果你的。 htaccess文件不可寫,去到你的WordPress安裝的根目錄,並添加它告訴你添加(下面):

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

我有相同的htaccess規則,但它不工作。 – sandipshirsale

+0

你有沒有設置你的永久結構? – SMacFadyen

+0

是的,我設置了永久鏈接結構 - >%postname% – sandipshirsale

相關問題